BMX 1.33: LoadImage / Loadiconstrip memory leak

Archives Forums/BlitzMax Bug Reports/BMX 1.33: LoadImage / Loadiconstrip memory leak

Grisu(Posted 2009) [#1]
Hello!

The following example will give you a constant rise in memory usage until it finally crashes after wasting 2 GB.

The leak occurs if you use "Loadimage" or "Loadiconstrip".



* Only tested under Windows 7 (64 Bit) and Win XP(x86) so far.

Grisu


GfK(Posted 2009) [#2]
Not sure exactly what the trouble is but there's something up with your Framework/Imports. Take that out, and it works fine.


Grisu(Posted 2009) [#3]
Even if you take out the framework completely, the memory leak is still there.

Slower but still there. Just take a bigger image for testing and you should see it easier.


GfK(Posted 2009) [#4]
Even if you take out the franework completely, the memory leak is still there.

Slower but still there. Just take a bigger image for testing and you should see it easier.


Well, I've had a play around with this using a 1024x1024 image. The memory usage goes up pretty quickly to about 400mb, but then it drops back down to hardly anything, then goes up again, drops down, etc etc.

If I build in threaded mode, GC never seems to clean up and the memory usage goes up and up.

So yep, deffo a pretty nasty bug.

[edit] Another odd thing - GCMemAlloced() seems to bear no correlation whatsoever to what Taskmanager says?


impixi(Posted 2009) [#5]
Gfk:
Another odd thing - GCMemAlloced() seems to bear no correlation whatsoever to what Taskmanager says?


It doesn't. See here.


Otus(Posted 2009) [#6]
In non-threaded mode the memory fluctuates between 20-100MB, but does not seem to be increasing. In threaded mode it fluctuates between 200-1000MB, but again does not seem to be leaking. Only watched for a couple of minutes, though.

Vista32, 3GB RAM