Memory leak when global project saved

There seems to be a memory leak in one of my projects. Looking at the memory trend graph from the gateway status page, the increases in the non-heap seem to correlate to when I save my "Global" scripting project. The decrease is when I restarted the gateway. The "Global" project is the root of all inheritance and the designated gateway script project (default behavior from the 7.9 -> 8.0 conversion).

I assume there's something in a script library of one of the projects that is causing some memory to leak every time the script manager is restarted, and saving its parent project, "Global" is causing the restart.

Is there an easier way to look for this memory leak than opening projects individually and saving them a few times to see if that causes a similar non-heap memory increase? Is there anywhere else I should look where memory leaks are common?

Look for uses of system.util.getGlobals() and/or system.util.globals anywhere. The persistent dictionary is easily abused to make memory leaks.

Also look in thread dumps for long-lived threads started with system.util.invokeAsynchronous(). A project save will not kill already-started threads, and those continuing threads will lock the entire old interpreter in RAM, leaking gobs of memory.

Finally, look for uses of SDK methods where jython listeners are added to platform infrastructure. Those will also attach old jython code+interpreter as a memory leak.

3 Likes