Shapyi
Joined: 25 Apr 2005 Posts: 95
|
Posted: Sat Feb 16, 2008 9:16 am Post subject: Available memory? |
|
|
I wrote a basic program that uses the graphics source code from Lua Player (graphics.h) and I am using psplink to play around. Before running the code I run "meminfo" and get:
| Code: | Memory Partitions:
N | BASE | SIZE | TOTALFREE | MAXFREE | ATTR |
--|------------|----------|-----------|-----------|------|
1 | 0x88000000 | 3145728 | 410112 | 396288 | 000C |
2 | 0x08800000 | 25165824 | 25069056 | 25069056 | 000F |
3 | 0x88000000 | 3145728 | 410112 | 396288 | 000C |
4 | 0x88300000 | 1048576 | 1048576 | 1048576 | 000C | |
Then I run the program, load a small image (32 x 32 jpeg) and get:
| Code: | Memory Partitions:
N | BASE | SIZE | TOTALFREE | MAXFREE | ATTR |
--|------------|----------|-----------|-----------|------|
1 | 0x88000000 | 3145728 | 403968 | 396288 | 000C |
2 | 0x08800000 | 25165824 | 1209856 | 951808 | 000F |
3 | 0x88000000 | 3145728 | 403968 | 396288 | 000C |
4 | 0x88300000 | 1048576 | 1048576 | 1048576 | 000C | |
Where did all the memory go? How did it go from 25,069,056 bytes to a mere 1,209,856 bytes? I tried just initializing the the graphics and loading no images and got:
| Code: | Memory Partitions:
N | BASE | SIZE | TOTALFREE | MAXFREE | ATTR |
--|------------|----------|-----------|-----------|------|
1 | 0x88000000 | 3145728 | 403968 | 396288 | 000C |
2 | 0x08800000 | 25165824 | 23298560 | 22088704 | 000F |
3 | 0x88000000 | 3145728 | 403968 | 396288 | 000C |
4 | 0x88300000 | 1048576 | 1048576 | 1048576 | 000C | |
Is 'meminfo' accurate and the graphics code just wastes 20+ MB of RAM just to load a simple image? Is there any other way to get an accurate reading of the available memory?
Thank you. |
|