|
Increased memory usage after repeated al_create_display calls |
dthompson
Member #5,749
April 2005
|
I'm using Allegro with OpenGL/Ubuntu, and have noticed some weird behaviour with my game's memory usage after doing repeated display shutdowns/creations. Overall usage begins at around 8MB, then begins to rise to ~18MB after a few re-creations. However, it's capped there; it doesn't rise any further than this no matter how many times I continue to shutdown/create. Whilst I'm reloading my sprites from disk as part of this process, I can't see any obvious leak in my own code, and Valgrind seems to agree with this. So, I'm led to believe that this isn't a standard memory leak, and something else is going on here. So does anyone have any ideas why this would be? Are Allegro or OpenGL applying some sort of pre-emptive allocation or GC? ______________________________________________________ |
Elias
Member #358
May 2000
|
How do you measure memory usage? Most of the ways I know about are not really useful at this level. E.g. compile a file which just calls malloc(10000000) and look at it in htop and it will say something like 1MB instead of 10MB. -- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
There's no memory leak. It's just increased page memory usage, up until the point where it doesn't think it needs to allocate any more pages. You'll get the same behavior on Windows, or most likely any other operating system. No need for concern, especially if Valgrind says its ok. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
dthompson
Member #5,749
April 2005
|
Thanks both - that makes sense. I'm just checking this with GNOME's system monitor (ie. a GUI for top). ______________________________________________________ |
|