Hi, I'm in a situation very similar to that one: http://forums.ps2dev.org/viewtopic.php? ... gmentation
I am loading/freeing lots of objects of various sizes (from a few dozen bytes to several MB), quite a lot.
After a while, the PSP crashes, apparently when trying to load a huge image (I need to calculate exactly, but the texture probably takes more than 1MB in Ram).
The most obvious culprit is a memory leak somewhere in my code, but is it theoretically possible that, with loading/freeing lots of various objects, I reached a state where my RAM is fragmented and unable to allocate space for a huge block of data ?
Ram fragmentation?
-
- Posts: 107
- Joined: Sat Jan 13, 2007 11:50 am
No, the game works fine for a while, it fails at a state where the quantity of Ram needed is supposed to be "stabilized"Coldbird wrote:Doesnt have to be a leak... maybe you just load too much shit at once...
Keep in mind that depending on how many modules and stuff is loaded you can easily max out the 24MB of useable RAM...
-
- Posts: 107
- Joined: Sat Jan 13, 2007 11:50 am
Yes. I was thinking of using one of the tricks I saw here numerous time (calling malloc with a growing number of bytes to determine the maximum size block).J.F. wrote:Well then, the obvious thing to do here is to put an extra check at the allocation function(s) and goto a special debugger routine when allocation fails just to see what's going on.
I just wanted to make sure that "Ram fragmentation" is something that actually happens, or if it's just something I made up. (I don't know how the malloc algorithms work precisely)
-
- Posts: 107
- Joined: Sat Jan 13, 2007 11:50 am