Maya process memory stays high after File > New Scene: leak or allocator retention?
0 reputation · 30 Jun 2020, 08:07 UTC
0 reputation · 30 Jun 2020, 08:07 UTC
During long Maya sessions, resident memory climbs steadily and is not returned to the OS after closing a heavy scene with File > New Scene. The only eventual failure condition is a platform-dependent out-of-memory crash, so there is no error string to anchor diagnosis. The unresolved question is how to classify this growth before it reaches that point.
Two documented contributors complicate the picture: the undo queue, whose length is configurable via the undoInfo command and which grows without bound under default settings, and the evaluation/dependency-graph caches retained in Parallel and Evaluation Manager modes. On top of that, Maya's memory allocators and loaded plug-ins are known to retain arenas even after scene data is destroyed, so Task Manager or top numbers alone cannot distinguish a genuine leak from fragmentation and retention. Third-party plug-ins and Python API reference cycles (including legacy MScriptUtil misuse) add further suspects.
Assume a recent Maya version on Windows or Linux, with behavior potentially differing by evaluation mode and OS allocator.
undoInfo and flushing caches reliably cap growth, or is a full restart the only guaranteed reclamation?35275 reputation · 30 Jun 2020, 14:01 UTC
1. Is there a supported way to attribute Maya’s resident memory to the undo queue, evaluation caches, or plug‑in allocations, short of external heap profiling?
undoInfo -display. You can set a hard limit with undoInfo -maxUndoLevels 50 or undoInfo -unlimited false to force a cap.evalInfo -clearCaches to flush DG/Parallel caches.-noexec flag to skip user scripts and plug‑ins, then compare RSS before and after a New Scene. If the difference disappears, the culprit is likely a plug‑in.These commands give you a rough attribution, but they do not provide a fine‑grained breakdown like a heap profiler would.
Setting a low maxUndoLevels and clearing caches will stop the rate of RSS growth, but Maya’s internal allocators (C++ arenas, Python memory manager) often keep freed blocks for reuse. As a result, the OS may still report a high RSS even after the undo data is gone. Only a full process restart guarantees that all retained arenas are returned to the OS.
maya -noexec (no user scripts, plug‑ins, or startup files). Record RSS with ps -o rss= -p $$ (Linux) or Get-Process -Id $PID | Select-Object WorkingSet64 (PowerShell).undoInfo -maxUndoLevels 20
undoInfo -unlimited false
evalInfo -clearCaches
-noexec). If RSS remains high after the same sequence, the extra memory is likely held by a plug‑in or a Python reference cycle.By comparing the two runs, you isolate allocator retention (present in both) from plug‑in leakage (present only in the full‑load run).
Do you have any third‑party plug‑ins or custom Python scripts loaded during the session? If so, they might be the source of the persistent memory, and the recommendation would shift toward disabling them or investigating their own memory handling.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.