FMOD Studio 2.03.08 – memory never released after each scripting terminal evaluation (TCP 3663)

FMOD Studio 2.03.08 – memory never released after each scripting terminal evaluation (TCP 3663)

Environment: FMOD Studio 2.03.08 (64-bit, Qt 6.5.3, build #153137), Windows 11 Pro (22000), 32 GB RAM.

Summary
Every expression evaluated through the scripting terminal port (3663) grows Studio’s private memory by
about 12-20 KB, and this memory is never released: not by studio._internal.runGC(), not by
Scripts > Reload, not by closing the TCP connection. Only quitting Studio frees it.
Our tool polls Studio’s profiler state 20 times per second (cursor/playhead sync with a video player),
which grew Studio by ~1.2 GB per hour. Over a work day this exhausted Windows’ commit memory and froze
the machine (Resource-Exhaustion-Detector events listing FMOD Studio.exe at up to 12.7 GB).

Steps to reproduce

  1. Open any project in Studio 2.03.08.

  2. Run this Python 3 script (standard library only):

    import socket
    s = socket.create_connection((“127.0.0.1”, 3663))
    def read_frame():
    buf = b""
    while not buf.endswith(b"\x00"):
    buf += s.recv(65536)
    read_frame() # greeting
    for i in range(20000):
    s.sendall(b"1")
    read_frame() # “out(): 1”

  3. Watch FMOD Studio’s commit size (Task Manager > Details > Commit size).

Measurements (same Studio instance)

  • 5,000 evaluations of “1”: +58 MB (~12 KB each)
  • 20,000 evaluations of a small JSON.stringify(…): +387 MB (~20 KB each)
  • Polling at 20 Hz: ~19 MB/min; at 5 Hz: 4.7 MB/min; no polling: 0 MB/min
  • studio._internal.runGC(): no change
  • Scripts > Reload (menu): no change (993 → 996 MB).
    studio.window.triggerAction(studio.window.actions.ScriptReload) is refused
    (“does not support the ScriptReload action”).
  • Closing the socket: no change

Expected: memory used by an evaluation is released once it completes, or at least by GC / script reload.

Question: is there a supported way to follow profiler session state (cursor, playhead, recording)
without polling, e.g. a callback a script can register to push changes to a terminal client?

Hi,

Thank you for bringing this to our attention. I have tried the code and cannot see an increase in the commit size within task manager. I increased the loop count to 100k → 1 million but did not see any increase in commit size.

I may be missing something to reproduce the issue? I have tried both 2.03.08 and 2.03.15 and our set ups are very similar.

Hi,

The human speaking (sorry for bad english) :slight_smile:

Thanks for your time. I would like to say that this analysis come from an AI agent I use. My level in code is not really good. So I sent to you the report my agent build. Just to say, I would like you to know that you can take energy and time for other subjects that could be a priority for you. Here, the aim of my actions is first to have a bridge between OBS Studio and FMOD Profiler for me to record a video of my in-game playing and then be able to replay the session in the profiler with the video synchronized. Permitting me to be able to change my sounds and see the results directly from the video and the profiler set up in simulate mode. Regards, I let you with the AI analysis that you could ignore if you have more important subjects to do. But if I could help investigating with more deep and depth analysis on my computer, I would be happy to help to find what is happening. Best regards.

The py file :

fmod_terminal_leak_repro_py.txt (2.0 KB)

The AI analysis :

Thanks for looking into it. I re-ran the exact script from my report today, and it reproduces
on my machine every time, on a vanilla setup:

  • Studio freshly restarted, blank project (File > New, unsaved), no user scripts at all
    (%LOCALAPPDATA%\FMOD Studio\Scripts empty), no other client connected to port 3663,
    Console window closed:
    5,000 evaluations of “1” → commit size +99 MB (about 20 KB per evaluation).
  • Same result with our real project open: +99 MB for 5,000 evaluations.
  • Without any evaluation, commit size stays flat (+0.3 MB over 30 s).

I’ve attached the script I used to measure (fmod_terminal_leak_repro.py, Python 3 standard
library only). It reads FMOD Studio.exe’s private bytes, which is what Task Manager shows as
Commit size, before and after N evaluations, and prints the difference.

My environment:

  • FMOD Studio: Version 2.03.08, 64-bit, Qt 6.5.3 under LGPL, Build #153137
  • Windows 11 Pro 21H2, build 10.0.22000

Since our setups look similar, could the Windows version be the difference? Which Windows build
did you test on? I’m happy to run any diagnostic build, or to capture a trace or a memory
dump on my side if that helps.

Thanks,
Vincent

Apologies for my delayed response.

Thank you for the additional information. I will continue to investigate the issue and get back to you with my findings.