# Memory Allocation in low RAM environments

**URL:** <https://www.ruby-forum.com/t/memory-allocation-in-low-ram-environments/130679>\
**Category:** Ruby\
**Created:** [March 1, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/memory-allocation-in-low-ram-environments/130679 "2008-03-01T19:38:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [March 1, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/memory-allocation-in-low-ram-environments/130679/1 "2008-03-01T19:38:59Z")

</div>

Reading up on garbage collection and memory allocation in Ruby and I’ve  
just learned of the fact that Ruby allocates a minimum heap of  
8000kbytes.

Is there anything I need to be wary of if reducing this to something  
much smaller, like say between 512-1024kbytes?

I think that minimum heap size is causing me problems in my Arm-WinCE  
environment where we get approx 38000-40000kbytes to use from the  
initial 64megabytes, once the OS and framebuffer has taken its share.

-John

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [March 1, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/memory-allocation-in-low-ram-environments/130679/2 "2008-03-01T20:27:44Z")

</div>

On Sat, Mar 1, 2008 at 7:38 PM, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> -John

In the gc.c file you’ll find:

#ifndef GC\_MALLOC\_LIMIT  
#if defined(MSDOS) || defined( **human68k** )  
#define GC\_MALLOC\_LIMIT 200000  
#else  
#define GC\_MALLOC\_LIMIT 8000000  
#endif  
#endif

You may try playing with that number. Warning: I know almost nothing  
about ruby internals,  
so I won’t tell you the possible consequences, nor the sensible lower  
bound for the number.

Jano
