Garbage collection (crashing on Windows)
Richard Gaskin
ambassador at fourthworld.com
Thu Aug 18 11:16:50 EDT 2016
Ben Rubinstein wrote:
> The real problem is that the script was written originally 13 years
> ago, and the basic architecture was to load everything into large
> global arrays for cleanliness. Over that period, the size of the data
> has multiplied over the years by 1-2 orders of magnitude....
Just how big is the data you need to work with in RAM at any given time?
> My two biggest problems are:
>
> - LC just in effect crashes/halts, rather than throwing an error so
> the app could at least report the problem
The challenge with low-memory conditions are that if there isn't enough
RAM to operate normally there may not be enough RAM to report that
through normal error-handling mechanisms.
It would certainly be nice to have reliable out-of-memory reporting, but
I've never seen in it any xTalk yet.
> - as far as I can tell, when I empty globals etc the memory isn't
> being recovered. This is really the root of my problem.
At first glance that sounds like a bug. If you can find a way to create
a simple test case to demonstrate a global not freeing up RAM after
being emptied I'll bet the team could fix it quickly.
Grasping at straws here, I wonder if introducing an idle after the
emptying might help, e.g.:
put empty into gSomeVar
wait 0 with messages
That should normally surrender control to the OS event loop, and if
that's needed to complete the clearing of the RAM you may have a
workaround for now.
I'd still call it a workaround, though, since we can't expect newcomers
to be able to guess about such things; ideally the engine would clear
memory when we ask it to.
If "put empty..." doesn't work, I wonder if this might trigger something
more complete:
delete variable gSomeVar
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list