Garbage collection (crashing on Windows)

Ben Rubinstein benr_mc at
Wed Aug 17 13:52:33 EDT 2016

Please refresh my memory: is there any way to cause/allow garbage to be 
collected without ending all script running?

I have an app which process large amounts of data. It runs fine on Mac, but on 
Windows intermittently (but not frequently as the application data source, 
which fluctuates, is gradually increasing) as the total memory in use 
approaches 2GB, the app faults.

Obviously this is very distressing for me and my client, because the app has 
lost control at this point and can't even tell us what's happening (it 
normally runs on a schedule on a VM, so it often takes days to discover that 
the system downstream hasn't been updated for a while, and trace back to find 
that the LC app is halted).

I have managed to reduce the incidence of this by breaking the processing into 
two parts, but this is undesirable for various reasons, and only palliative. 
What I really want is a way for my main function to invoke garbage collection 
after calling some of the larger processing steps.

Is there any way to do this? Am I right in thinking that the issue is related 
to LC's total memory usage reaching 2GB on Windows? Are there any useful 
functions (e.g. the "hasMemory" function is documented as "only partially 
implemented, and may not return useful values on some platforms", which makes 
it seem pretty pointless...)?



More information about the Use-livecode mailing list