| View previous topic :: View next topic |
| Author |
Message |
Mon Ouïe
Joined: 05 Jul 2009 Posts: 36
|
Posted: Fri Oct 30, 2009 6:01 am Post subject: Not enough memory with Ruby 1.9 |
|
|
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 |
|
 |
Criptych
Joined: 12 Sep 2009 Posts: 79
|
Posted: Fri Oct 30, 2009 6:57 am Post subject: Re: Not enough memory with Ruby 1.9 |
|
|
| 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 |
|
 |
Mon Ouïe
Joined: 05 Jul 2009 Posts: 36
|
Posted: Fri Oct 30, 2009 7:14 am Post subject: |
|
|
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 |
|
 |
Criptych
Joined: 12 Sep 2009 Posts: 79
|
Posted: Fri Oct 30, 2009 7:39 am Post subject: |
|
|
| 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 |
|
 |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Fri Oct 30, 2009 8:27 am Post subject: |
|
|
| 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 |
|
 |
Mon Ouïe
Joined: 05 Jul 2009 Posts: 36
|
Posted: Sat Oct 31, 2009 2:55 am Post subject: |
|
|
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 |
|
 |
|