Application Memory (memory leak?)

I’ve been pounding away on a fairly complex applet (probably more complex than necessary) that uses Dialog Toolkit Plus to display a window.

For the third time now I’ve gotten a dialog asking me to force quit script debugger because my mac is running out of application memory. The dialog has a list of running apps, and each has a few hundred mbs of application memory, while Script Debugger has 15+ gigabytes of memory.

I am able to save the open scripts but SD stalls if I try to quit, and have to force quit.

This has only happened with Script Debugger running this applet, so somewhere between SD and Dialog Toolkit there seems to be a memory leak.

If it’s Script Debugger, it’s probably too late to fix.

When you run an applet in Script Debugger, if the app leaks memory, Script Debugger memory leaks. And the sad reality is that AppleScriptObjC leaks memory, sometimes lots of it.

In an applet, that doesn’t normally matter; it keeps asking for more memory, and it all gets cleared when it quits. It’s just the price of admission. But in Script Debugger, the leaks mount up.

AppleScriptObjC was written in the days when macOS had optional automatic memory management (garbage collection). When that was abandoned, I don’t think any serious attempt was made to address the issue in ASObjC.

1 Like