forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"not enough memory" ?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Julu Julu



Joined: 01 Nov 2005
Posts: 9
Location: Germany

PostPosted: Wed Nov 09, 2005 9:06 am    Post subject: "not enough memory" ? Reply with quote

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

Code:
not enough memory
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Wed Nov 09, 2005 12:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Wed Nov 09, 2005 2:50 pm    Post subject: Reply with quote

hehe..
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Sun Nov 13, 2005 11:01 am    Post subject: Reply with quote

is there a way somehow to use the MS as swap?
(or are all the games using only 32Megs?)
m
Back to top
View user's profile Send private message
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Sun Nov 13, 2005 11:04 am    Post subject: Reply with quote

Most memory sticks are too slow to use as swap.
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Master Inuyasha



Joined: 13 Nov 2005
Posts: 13

PostPosted: Sun Nov 13, 2005 1:38 pm    Post subject: Reply with quote

by the way, what is an array?
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Sun Nov 13, 2005 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Sun Nov 13, 2005 11:31 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group