| View previous topic :: View next topic |
| Author |
Message |
Julu Julu
Joined: 01 Nov 2005 Posts: 9 Location: Germany
|
Posted: Wed Nov 09, 2005 9:06 am Post subject: "not enough memory" ? |
|
|
Hi.
I made an Array in LuaPlayer.
| Code: |
for i=0,3000 do
Array[i] ={}
for j=0,3000 do
Array[i][j] = 555555
end
end
|
But if I start the program, then I get this error message
|
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Nov 09, 2005 12:48 pm Post subject: |
|
|
Hmm... let's calculate how much memeory it needs.
Each element of the 2-D array needs 4 bytes to store a number. Hence, 3000 x 3000 x 4 = 36,000,000. That's a lot for PSP"s RAM! Doesn't it have only 32 MB RAM? _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
chaos
Joined: 10 Apr 2005 Posts: 135
|
Posted: Wed Nov 09, 2005 2:50 pm Post subject: |
|
|
hehe.. _________________ Chaosmachine Studios: High Quality Homebrew. |
|
| Back to top |
|
 |
mrn
Joined: 02 Nov 2005 Posts: 116
|
Posted: Sun Nov 13, 2005 11:01 am Post subject: |
|
|
is there a way somehow to use the MS as swap?
(or are all the games using only 32Megs?)
m |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Sun Nov 13, 2005 11:04 am Post subject: |
|
|
Most memory sticks are too slow to use as swap. _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
Master Inuyasha
Joined: 13 Nov 2005 Posts: 13
|
Posted: Sun Nov 13, 2005 1:38 pm Post subject: |
|
|
| by the way, what is an array? |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Sun Nov 13, 2005 2:26 pm Post subject: |
|
|
If any number in the array is smaller than +-128, share each memory 4-byte cell for two numbers. Would it help, I hope? _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Sun Nov 13, 2005 11:31 pm Post subject: |
|
|
| Master Inuyasha wrote: | | by the way, what is an array? |
A group of data entries being referenced by the same variable name
in php
| Code: |
<?php
$blah = array(0,1,2,3,4,5,6,7,8,9);
echo $blah[5]; // would return "4" because it's the fifth index
?>
|
_________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
|