Only ever grows? (was: Re: [squeak-dev] how/where is memory returned to the OS?)

Chris Muller asqueaker at gmail.com
Mon Oct 22 02:35:15 UTC 2012


> Unfortunately there is no easy fix , which will fit all possible use scenarios.
> As you can see from comments in code, this feature was disabled on purpose
> for cases when your application works extensively with external
> resources/libraries,
> which using malloc() a lot.

You mean FFI?  Someone took the trouble to write this for the manpage.
 My gut thinks FFI has been around longer than the releasing of memory
feature -- not sure.

       -mmap size[mk]
              requests that a variable heap of at most  size  bytes  be  allo‐
              cated.   (The  suffixes  are  as  described  for  the  '-memory'
              option.)  squeak will initially allocate a heap  that  is  large
              enough  to  hold the image, with a small amount of headroom.  If
              at any time Squeak requires more memory for its image then addi‐
              tional space will be allocated dynamically.  Likewise, when mem‐
              ory is no longer needed it will deallocated and returned to  the
              system.   The size argument places an upper limit on how big the
              heap can grow in this fashion.  squeak uses a  dynamic  heap  by
              default  with  the maximum size set to 75% of the available vir‐
              tual memory or 1 gigabyte, whichever is smaller.

Eliot, is the useMmap variable you referred to set by this argument?
I tried launching my image with -mmap 700M but it still didn't seem to
want to deallocate.

Same with the Classic VM.


More information about the Squeak-dev mailing list