FIXED: Empty CHOP Execute DAT callbacks leak ~32 bytes per call (2025.33070, 2025.33230, Windows 11)

Hi,

In TouchDesigner 2025.33070 and 2025.33230 (Windows 11, Python 3.11.15), every call of a CHOP Execute DAT callback whose body is empty leaves one small allocation behind. “Empty” means the body is only return, pass, or a docstring. As soon as the body has any real statement (even x = 1), nothing is left behind.

This matters because the default CHOP Execute template contains empty callbacks, and it is easy to leave their toggles (While On / While Off / Value Change) enabled.

How we measured
sys.getallocatedblocks() sampled 15–20 seconds apart, at 60 fps.

Minimal reproduction

  1. In an empty Base COMP, create one Constant CHOP (one channel, value 1).
  2. Create 20 CHOP Execute DATs pointing at it, with only While On and While Off enabled.
  3. Change only the callback body and measure the growth of sys.getallocatedblocks():
def whileOn(channel, sampleIndex, val, prev):
    return          # variant A: leaks
def whileOff(channel, sampleIndex, val, prev):
    return
def whileOn(channel, sampleIndex, val, prev):
    x = 1           # variant B: no leak
    return
def whileOff(channel, sampleIndex, val, prev):
    x = 1
    return

Result (20 DATs × 60 fps = 1,200 calls per second)

Callback body Extra blocks per second
return +1,230
pass +1,236
docstring + return +1,229
x = 1 +25 (noise)
a parameter assignment +38 (noise)

The same happens with Value Change when the value changes every frame, and on 2025.33230 (+1,221 blocks/s for 20 empty whileOn).
tracemalloc shows the growth as 32-byte allocations with no Python frame (allocated from C), and they are not gc-tracked objects.

In a real project, empty callbacks left enabled (41 called every frame) were the whole of a steady memory growth of about 2–3 MB per minute. Disabling the toggles of the empty callbacks brought the growth to zero, with no change in behaviour.

Workaround
Turn off the toggles of empty callbacks (or delete them, or put a real statement in them).

Environment

  • TouchDesigner 2025.33070 and 2025.33230 (Commercial), Windows 11 Pro, Python 3.11.15.
  • Not checked: 2023 builds, macOS.
  • This is separate from the round() tuple leak we reported in another post.

Thanks.

Thanks, we’ve having a look at this case as well.

This will be fixed in builds 2025.33358 and later. Cheers