From: Jano Svitok Date: 2008-06-10T23:48:19+09:00 Subject: Re: allocate particular amount of memory to a ruby thread ? On Tue, Jun 10, 2008 at 13:46, Pokkai Dokkai wrote: > how to allocate particular amount of memory to a ruby thread or to a > ruby script? > > for example suppose if i want to start a thread it should take 1 MB > memory only > > Thread.start(memory=1024*1024*1024) do |t| > > # some stuff here > end > > is there anyway to do like this ? AFAIK, the memory is shared among threads, no matter whether system or ruby's. The memory for the whole ruby process/script is allocated on demand, with some initial amount. This amount and growing ratio is compiled-in (at least for 1.8).