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 with Ruby 1.9

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Mon Ouïe



Joined: 05 Jul 2009
Posts: 36

PostPosted: Fri Oct 30, 2009 6:01 am    Post subject: Not enough memory with Ruby 1.9 Reply with quote

Hi,

I'm trying to run Ruby 1.9. The problem I get is a "[FATAL] failed to allocate memory". It seems to be outputed by a xmalloc2. Since Ruby isn't totally initialized, it'd be really strange if we have not enough memory for this. Therefore I belive the problem is in my code.

I have :
Code:
PSP_LARGE_MEMORY = 1

in my code, and no PSP_HEAP_SIZE_KB macros. Should I do anything else in order to fix that ?
Back to top
View user's profile Send private message
Criptych



Joined: 12 Sep 2009
Posts: 79

PostPosted: Fri Oct 30, 2009 6:57 am    Post subject: Re: Not enough memory with Ruby 1.9 Reply with quote

Mon Ouïe wrote:
I have :
Code:
PSP_LARGE_MEMORY = 1

in my code, and no PSP_HEAP_SIZE_KB macros. Should I do anything else in order to fix that ?

Make sure you do use PSP_HEAP_SIZE_KB (or PSP_HEAP_SIZE_MAX), or your program will be given only the default heap size - I don't know exactly how much that is, but it's not very big.
Back to top
View user's profile Send private message
Mon Ouïe



Joined: 05 Jul 2009
Posts: 36

PostPosted: Fri Oct 30, 2009 7:14 am    Post subject: Reply with quote

I tried those macros like :
Code:
PSP_HEAP_SIZE_KB(1024 * 32);

And yes, the program run longer. It ends somewhere in ruby_thread_init_stack. It really looks like a lack of memory, but I can't understand how this could take as much memory - therefore, I just belive it doesn't...
Back to top
View user's profile Send private message
Criptych



Joined: 12 Sep 2009
Posts: 79

PostPosted: Fri Oct 30, 2009 7:39 am    Post subject: Reply with quote

Mon Ouïe wrote:
Code:
PSP_HEAP_SIZE_KB(1024 * 32);

AFAIK you can't go all the way to 32, since only ~24MB are actually available for programs. Try using 8-16, or if you really need a lot of memory, just use PSP_HEAP_SIZE_MAX, which allocates all available memory for your heap.
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri Oct 30, 2009 8:27 am    Post subject: Reply with quote

Criptych wrote:
Mon Ouïe wrote:
Code:
PSP_HEAP_SIZE_KB(1024 * 32);

AFAIK you can't go all the way to 32, since only ~24MB are actually available for programs. Try using 8-16, or if you really need a lot of memory, just use PSP_HEAP_SIZE_MAX, which allocates all available memory for your heap.


You're better off starting from -256 and heading down.

-256 allocates all but 256kb to your program (some plugins might run in the background blah blah blah)

so

Code:
 PSP_HEAP_SIZE_KB(-256);
Back to top
View user's profile Send private message AIM Address
Mon Ouïe



Joined: 05 Jul 2009
Posts: 36

PostPosted: Sat Oct 31, 2009 2:55 am    Post subject: Reply with quote

Thanks, but it doesn't work either. It hangs at the same point. The result is the same with PSP_HEAP_SIZE_MAX.

Should I trace memory allocation in order to find out if and where there is a problem ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP 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