"not enough memory" ?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Julu Julu
Posts: 9
Joined: Tue Nov 01, 2005 8:57 am
Location: Germany

"not enough memory" ?

Post by Julu Julu »

Hi.

I made an Array in LuaPlayer.

Code: Select all

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

Code: Select all

not enough memory
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

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
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

hehe..
Chaosmachine Studios: High Quality Homebrew.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

is there a way somehow to use the MS as swap?
(or are all the games using only 32Megs?)
m
Zenurb
Posts: 106
Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:

Post by Zenurb »

Most memory sticks are too slow to use as swap.
Proud Dvorak User
US 1.5 PSP (Original)
Master Inuyasha
Posts: 13
Joined: Sun Nov 13, 2005 9:55 am

Post by Master Inuyasha »

by the way, what is an array?
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

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
Zenurb
Posts: 106
Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:

Post by Zenurb »

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: Select all

<?php

  $blah = array&#40;0,1,2,3,4,5,6,7,8,9&#41;;

  echo $blah&#91;5&#93;; // would return "4" because it's the fifth index

?>
Proud Dvorak User
US 1.5 PSP (Original)
Post Reply