how do you determine how much ram is left?
how do you determine how much ram is left?
I think there's a memory leak in the new build of raptor animation system, cos although it works fine and the zombie i'm looking at animates, if i leave it running for about 30 seconds it just hangs.
And there's very left logic in the demo, just displays a mesh.
So, any function like sceGetRam() sceGetRamTotal() etc?
I did a search of the includes but couldn't find nothing obvious.
Also, anything to determine how much vid mem there is left?
And there's very left logic in the demo, just displays a mesh.
So, any function like sceGetRam() sceGetRamTotal() etc?
I did a search of the includes but couldn't find nothing obvious.
Also, anything to determine how much vid mem there is left?
Re: how do you determine how much ram is left?
To find memory leaks, I recommend using a debug memory manager, like the one from Paul Nettle of fluidstudios.com. It's a C++ version though, so if you have C code, you could try my ANSI-C version of it from here: http://www.fx-world.org/wordpress/?p=15Kojima wrote:I think there's a memory leak in the new build of raptor animation system, cos although it works fine and the zombie i'm looking at animates, if i leave it running for about 30 seconds it just hangs.
And there's very left logic in the demo, just displays a mesh.
So, any function like sceGetRam() sceGetRamTotal() etc?
I did a search of the includes but couldn't find nothing obvious.
Also, anything to determine how much vid mem there is left?
It's pretty easy to use, just #include "mmgr.h" in all files which do memory allocation before your project includes (but after all <...> includes) and then call the memreport dump function once at the end of your program (not needed in the C++ version, as this is handled through the static deallocation of a class).
You'll get a perfect listing of all allocations which weren't freed correctly and where in your code they happend (if any).
Regarding the VRAM stuff, there's not much to do unless you handle all your VRAM usage through an external mem manager (like my valloc library which provides you with a vmemavail() function that returns the free VRAM). This however only works if you allocate all your VRAM with the provided valloc function.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
There was a thread about that some time ago with a solution to that, you should be able to find it if you use the search. It was something about a value in the heap header struct.Kojima wrote:ok thanks i'll give that a go. I still would like to know how much memory my app is using though, and how much is left, is it possible on a psp?
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
That looks like an awesome tool Raphael, thanks for the link. I tried to compile mmgr.cpp (with a makefile used for a c++ app) but it fails around new_handler. The docs say to replace std::set_new_handler with set_new_handler, but that doesn't help because new_handler is still not found. Where is new_handler usually located on the PSP, or is there a workaround? (I'm using Nettle's original code)
@Kojima, this has been asked a few times, I coded a crude one myself, and there is another one here: http://forums.ps2dev.org/viewtopic.php?p=33937
@Kojima, this has been asked a few times, I coded a crude one myself, and there is another one here: http://forums.ps2dev.org/viewtopic.php?p=33937
Try to #include <new.h>, I'm not sure if that helps though, haven't tried C++ on PSP yet.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
That example appears to be broken (I searched for it).
http://forums.ps2dev.org/viewtopic.php? ... ccce7aa9cd
I gave it a shot to be sure, but it doesn't compile for me.
http://forums.ps2dev.org/viewtopic.php? ... ccce7aa9cd
I gave it a shot to be sure, but it doesn't compile for me.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Or it could be running on a firmware version you didn't expect.Art wrote:Yep, I got it now :)
So if there is more RAM consumed than my program expects, it must
have been launched from a shell, which is what I wanted to determine
at run time.
Cheers, Art.
Or perhaps from one of these custom firmwares.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
The PSP Homebrew Database needs you!