CreateWindow Memory Leak
BlitzMax Forums/MaxGUI Module/CreateWindow Memory Leak
| ||
Hi! I dont know if im doing something wrong here, but i belive that the free gadget command for window has a memory leak: Import maxgui.maxgui Import maxgui.drivers Local lastCollected:Int Local currentCollected:Int For Local i:Int = 0 To 10 Local w:TGadget = CreateWindow("TestWindow", 0, 0, 200, 200, Null) w.Free() w = Null GCCollect() lastCollected = currentCollected currentCollected = GCMemAlloced() Print "Leak:" + (currentCollected - lastCollected) + ":" + currentCollected Next It shows how memory is slowly leaking, at least in my computer.. |
| ||
Changing the for next to a while true shows that memory usage stabilizes after first 30 or so iterations. |
| ||
http://www.blitzbasic.com/Community/posts.php?topic=91435 Perhaps this is related? When loading large images it climbs and climbs... Seems the size of what you load determines how high the gc will climb before firing... Something makes me think there's a connection... |
| ||
umm.. true, after some iterations memory stabilizes.. that's weird :S ... But i can live with that... at least it's not a real leak. ima747, i don't know about that, but i'll read those posts to see what can i learn... thanks :) |