How can the memory manager be replaced, repaired, or removed?
by Brian Mitchell · in Torque Game Engine Advanced · 01/25/2008 (3:18 pm) · 8 replies
Hello,
How can the memory manager be replaced, repaired, or removed? Have a large number of pages being allocated during initialization, but never released or reused.
Thanks much for your time.
How can the memory manager be replaced, repaired, or removed? Have a large number of pages being allocated during initialization, but never released or reused.
Thanks much for your time.
#2
01/25/2008 (4:52 pm)
#define TORQUE_DISABLE_MEMORY_MANAGERThat will turn it off. It's actually good practice to run with it off during development somewhat frequently. Because of how it works (What Stephen said) if you deallocate memory and then try to read it again, it will not cause an exception, because the application (Torque) is attempting to access memory that it owns...no problem.
#3
Thanks for your reply. The team I'm working with says: "We know why Torque is holding the memory, but we cannot reuse memory from the pages after we have released it back to the Memory Manager. It just keeps allocated new pages instead of reusing empty ones."
Thanks again
01/28/2008 (8:18 am)
Stephen,Thanks for your reply. The team I'm working with says: "We know why Torque is holding the memory, but we cannot reuse memory from the pages after we have released it back to the Memory Manager. It just keeps allocated new pages instead of reusing empty ones."
Thanks again
#4
Thanks for your reply. The team I'm working with says they already tried using: " #define TORQUE_DISABLE_MEMORY_MANAGER " and have come to the conclusion that it never worked properly.
Thanks
01/28/2008 (8:23 am)
Pat,Thanks for your reply. The team I'm working with says they already tried using: " #define TORQUE_DISABLE_MEMORY_MANAGER " and have come to the conclusion that it never worked properly.
Thanks
#5
01/28/2008 (8:46 am)
Your team has a memory fragmentation issue, which the TMM doesn't handle well. To fix it they should use the #define to turn off the memory manager. It does work properly. We dev our games with the memory manager turned off, and turn it on for release.
#6
Thanks for your fast reply. The team said turning off the memory manager wouldn't help things the way we are now. There is no way of explaining the problem clearly without breaking our companies NDA. Anyway, our companies coders are on a different path now.
Thanks for the replies
01/28/2008 (9:19 am)
Pat,Thanks for your fast reply. The team said turning off the memory manager wouldn't help things the way we are now. There is no way of explaining the problem clearly without breaking our companies NDA. Anyway, our companies coders are on a different path now.
Thanks for the replies
#7
We ran into a similar problem generating lightmaps for complex levels. Due to the fragmentation of the allocations, the memory manager kept allocating pages until it ran out of memory. Turning it off solved the problem entirely.
01/28/2008 (9:27 am)
Okay, well best of luck. We ran into a similar problem generating lightmaps for complex levels. Due to the fragmentation of the allocations, the memory manager kept allocating pages until it ran out of memory. Turning it off solved the problem entirely.
#8
01/29/2008 (8:59 am)
Our issue was that we use a ton of animations and the loading process tended to allocate 2-3x the mem used during actual gameplay, so we now keep it disabled.
Torque 3D Owner Stephen Zepp