Loading ...
Sorry, an error occurred while loading the content.

12885Re: "ocaml_beginners"::[] Monitor memory usgae from executing ocaml code

Expand Messages
  • rixed@happyleptic.org
    Aug 2, 2011
      > It always requests more memory from the operating system than you need
      > at the moment. It tries to allocate huge sequential chunks at once, so
      > it doesn't need to call malloc/mmap again and again for every small
      > allocation.

      Which is also how malloc works.
      IIRC from the runtime code, the main idea is to have all major heap
      values grouped together so that it's faster to tell if a value is in the major
      heap (thus must be traversed by the GC) by looking at its address (while a mere
      malloc would scatter objects here and there).

      Biggarays content does not need to be traversed by the GC (since they can contain
      only immediate values) and so are free to be malloced.

      Please correct me if I'm wrong.
    • Show all 11 messages in this topic