ASOC apps and virtual memory usage

Hi All,

I have been getting feedback from users that some of my ASOC apps are taking a big virtual memory hit. I see 300MB on my machine but some are reporting 800. I don’t see this as a problem really ( seeing as it is virtual mem) but wonder if this is just a product of the ASOC bridge and frameworks. I looked at some other’s ASOC apps, like Shane’s example apps, and see the same footprint even for a tiny demo app.

Cheers, Rob

First there are a lot of places to look but the first and important is, does the size of the script’s in the application packages (classes) grow? If so then you have an some sort of memory leak in your script. This seems almost not possible but working with script objects, which is for some people new, can make a stack overflow eventually. I call it a memory leak because when you set the properties and globals who are causing this problem to null before quitting will stop the problem.

Then are you sure the GC is turned on? In my xcode 3.2.6 “ I switched back to 3 “ GC is turned off by default. So Every AppleScriptObjC project I start I have to turn GC on.

Then there is of course the possibility that the machine is heavily loaded. The GC is some sort of secondary process with low priority inside the ObjC runtime environment.

This might help explain what’s happening:

Actually, a quote from the next message in the thread posted above is proabably worth quoting from:

DJ: GC should be turned on in the ASObjC templates. Perhaps you’re using “ordinary” Cocoa templates.

Nope I don’t everything is default the way it should be but maybe using xcode 3.x and 4.x simultaneous and then updating xocde 4 and then updating xcode 3 will eventually messed up my templates. But if this is default behaviour on my machine maybe the same could have happened to robdut. But you can see it by looking at the rsize as well if you have a memory leak.

Yes - that is pretty much what I thought about VSIZE but that helps me explain it more clearly to those worried. I did a sampling of my apps and several of your (Shane’s) sample ASOC apps and they all come up with 300 or so MB VSIZE, so it seems to be a footprint of ASOC with gc.

gc definitely ups the VSIZE as I switched it on in a plain obj-C app and it went from 30Mb to 180MB.

Thanks, Rob