Game Development Community

PlatformMemory allocation question

by James Spellman · in Torque Game Engine Advanced · 02/29/2008 (9:04 am) · 0 replies

I thought I had read about this somewhere but as usual, I can't find it.

We load lotsa of big things into RAM in our projects, so it was never a surprise to see the thing head upwards to a GB. That is until we tried turning off the Torque Memory Manager and found our actual usage was more like 400MB. So given that less is more, we went with the easy solution and turned it off.

That is until I had to debug something recently and in debug mode it ballooned to more than 2GB for our latest TGEA product, making it difficult to debug. In fact it usually crashes with some assert. Long story short: Without the mem manager it uses only 520MB. With it allocates over 130 pages of memory.

So then I tried the next obvious step and increased the MinPageSize from 8MB up to 32MB. Now it only allocates a new page once and it runs at a svelt 540MB. (I tried 8, 16, 32, 48 & 64 where 32 gave me te best results.) Oh, and there's no more asserting going on.

Now I know doesn't release what it allocates, but does it ever attempt to reuse what it's got? It seems to be just wasting it.