From: Emanuele Ricci Date: 2008-04-16T23:33:36+09:00 Subject: Re: ruby memory allocation M. Edward (Ed) Borasky wrote: > Emanuele Ricci wrote: >> Thank you in advance, >> Emanuele Ricci. > > That may not be Ruby's fault entirely. In many cases, the size of memory > chunks delivered by "malloc" and its friends is determined by the > compiler or operating system. I've worked on systems where you got the > next higher power of two, for example. If you asked for 5,000 you got > 8192, if you asked for 65 you got 128, etc. And many modern systems > won't give you less than a physical page. > > A physical page on most x86 operating systems is 4096 bytes, so 8 MB is > 2048 pages. There is also an option to run larger pages in Linux. What > OS and architecture are you on? > > P.S.: I'm cross-posting this to ruby-core -- that's where patches are > discussed. Thank you for answering. My app runs in a linux gentoo environment on an arm processor embedded device. I cross-compile ruby with an arm-linux compiler in a gnu linux host. The device has only 64Mb of ram and the last allocation of 8Mb happening when the process is near 30-32Mb results in a NOEMEM error. -- Posted via http://www.ruby-forum.com/.