Memory Allocation in low RAM environments

Discussion in 'Ruby' started by John Snowdon, Mar 1, 2008.

  1. John Snowdon

    John Snowdon Guest

    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
    --
    Posted via http://www.ruby-forum.com/.
    John Snowdon, Mar 1, 2008
    #1
    1. Advertising

  2. John Snowdon

    Jano Svitok Guest

    On Sat, Mar 1, 2008 at 7:38 PM, John Snowdon <> wrote:
    > 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


    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
    Jano Svitok, Mar 1, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page