Topic: Bug: ZIPE not freeing up memory / closing stream after usage?

Hi!

In my "Pocket Radio Player" I have a memory leak when I use the stream functions of your module a lot.
It also seems that the zip file is still "locked", even when I already have opened another one.

Example line:
ButtoIco_stop:TIconstrip=LoadIconStrip("zipe::skins\"+filename+"::prp_stop.png")

Is there a way to force the wrapper to close the stream / zip file and free the memory allocated?
The bmx Garbage Collector doesn't help here at all.

Thanks.

Grisu

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

greetings smile  i didnt see anything right away that would be an issue.  is it possible to whip up a bare-minimum example that i could run?

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

Here's a quick example.

Just read out an image of a zip file constantly and the task mananger memory usage will go up like crazy while the GC Collector stays the same?

I have already posted that issue in the BMX bug forum. But no one could help so far.

If you have any idea or wild guess, please let me know.

Framework brl.Jpgloader
Import brl.PNGloader
Import brl.Pixmap
Import gman.zipengine

SuperStrict 

Global MinMemUsage:Long=GCMemAlloced()
Global MaxMemUsage:Long=GCMemAlloced()
Global TempMemUsage:Long=0

While True <> False ' Endless loop!

Local ButtoIco_exit:TPixmap=LoadPixmap("zipe::skins\prp_red_win7.skn::prp_about.png")  ' Just an ordinary image file
TempMemUsage:Long=GCMemAlloced() 
If TempMemUsage > MaxMemUsage Then MaxMemUsage=tempMemUsage

Print "Min: "+MinMemUsage
Print "Max: "+MaxMemUsage
Print ""
Delay (10) ' free a little CPU time

Wend
End

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

thank you.  that will help me troubleshoot.  unforutnately i wont be able to look at this again for another 12 hours or so.  will look at it as soon as i can.

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

I have to thank you.

Take all the time you need.

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

greetings smile  could you please email me the skn file you are using (gman[@]gprogs.com).  i cant seem to replicate with the test ZIP i created.

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

thank you for the samples.  unfortunately i still cant replicate.  stays rock solid at:

Min: 27010
Max: 33727

the zipe wrapper already closes the zip file when its done reading.  i tried putting a debugstop in right after the loadpixmap call.  while stopped i was able to rename/delete the zip file.  i guess now we need to start looking at versions.  what version of the zipengine do you have.  blitzmax?  OS?

thank you.

Re: Bug: ZIPE not freeing up memory / closing stream after usage?

System Specs:
Win7 RC1 (64 Bit)
BMX 1.34 RC4
MAXGUI 1.33 RC1
GMAN ZIP 2.10

The GCCollector works fine though the memory usage in the "Taskmanager" keeps rising and rising until 2 GB of ram are full.

I got rid of the writeprotection problem by using the normal "zrObject.ExtractFile" command instead of the wrapper.

Btw: Is the reading via stream faster than extracting the files to ram and use them from there?