Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Increased memory usage after repeated al_create_display calls

This thread is locked; no one can reply to it. rss feed Print
Increased memory usage after repeated al_create_display calls
dthompson
Member #5,749
April 2005
avatar

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?

______________________________________________________
Website. It was freakdesign.bafsoft.net.
This isn't a game!

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.

--
"Either help out or stop whining" - Evert

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

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.

dthompson
Member #5,749
April 2005
avatar

Thanks both - that makes sense. I'm just checking this with GNOME's system monitor (ie. a GUI for top).

______________________________________________________
Website. It was freakdesign.bafsoft.net.
This isn't a game!

Go to: