Export Snapshot PNG Workaround

Richard Gaskin ambassador at fourthworld.com
Wed Mar 21 11:42:04 EDT 2007


Dave wrote:

> Problem 2.
> 
> Using the export snapshot command under the IDE results in memory  
> being leaked on each image exported.
> 
> The work around is to Compile the App into a Standalone and test  
> using a smaller number of files.

To clarify, this issue appears to be limited to the Rev IDE only, and is 
not evident in my testing with a standalone, with the MetaCard IDE, or 
my own custom fork of MC.  Also, it doesn't appear limited to the 
"snapshot" option, but is evident with all uses of the export command I 
tested.

When testing in Rev I even purged all front- and backScripts, and still 
the leak is evident.  So it seems fairly safe at this point to suggest 
that there is no problem with the engine or any of the IDE stacks. 
Standalones should be fine.

What does that leave us with?

The only other difference between Rev and MC that I can think of offhand 
is that Rev loads a lot of externals when it launches.  How the 
initialization of an external could affect the memory space used by the 
engine's export command is a mystery to me, but if someone has the time 
to try these tests removing one external after another from the install 
we could at least either pin down the culprit or rule out the role of 
externals in this altogether.


> Problem 3.
> 
> RunRev does not garbage collect until after a handler returns.
> 
> The work around is to have two handers and use the timed send command  
> process a smaller number of images at time.

I think this one may have been a misunderstanding of early test results. 
  When I run the same test under MC or in a standalone, I see the memory 
fluctuate a bit but never by very much (a MB or two), and while it's 
still running the allocation goes back down to roughly its original value.

This suggests that garbage collection is done even before idle, at least 
with the statements used in the test script you submitted to Support. 
There may be other circumstances where garbage collection must wait for 
idle, but I haven't seen any yet.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list