GMan's Mods & Stuff


Help and information forum for programs and BlitzMax mods written by GMan.
For games from GMan, visit G-Squared Games.
For web consulting check out ggSoftware.

You are not logged in.

Announcement

#1 2009-08-18 13:11:50

Grisu
Member
Registered: 2009-08-18
Posts: 16

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

Offline

 

#2 2009-08-18 20:12:23

gman
Administrator
Registered: 2006-01-04
Posts: 723

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?

Offline

 

#3 2009-08-19 02:22:47

Grisu
Member
Registered: 2009-08-18
Posts: 16

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.

Code:

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

Offline

 

#4 2009-08-19 06:00:38

gman
Administrator
Registered: 2006-01-04
Posts: 723

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.

Offline

 

#5 2009-08-19 06:41:02

Grisu
Member
Registered: 2009-08-18
Posts: 16

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

I have to thank you.

Take all the time you need.

Offline

 

#6 2009-08-20 19:50:15

gman
Administrator
Registered: 2006-01-04
Posts: 723

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.

Offline

 

#7 2009-08-21 18:56:06

gman
Administrator
Registered: 2006-01-04
Posts: 723

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.

Offline

 

#8 2009-08-24 03:40:16

Grisu
Member
Registered: 2009-08-18
Posts: 16

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?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB