I have currently a problem with memory fragmentation in my game (I think); I'm pretty sure about that because I tracked down every little memory leak I could have had (I used mallinfo), and there is none left.
When I compare the memory I have available before playing a level, with after I played, they are the same. No leak. But still after some times the game cannot load a png anymore (certainly a big contiguous memory structure).
So I thought about something, but I need some info; here is my idea. I could compile a prx per level/menu and launch them on demand. My asumption is that we can assign an amount of memory to a prx, load it, and when it's finished completely clear the memory part we assigned to it. Am I right with this? the launched prx should be able to use the "malloc", "free", "new", "delete" operators, and when unloaded get back to the same memory state we had before. Also the prx should be able to tell the main program what the user wants next, this is possible right?