[Vm-dev] Re: [squeak-dev] how/where is memory returned to the OS?

Eliot Miranda eliot.miranda at gmail.com
Fri Oct 19 19:42:00 UTC 2012

On Fri, Oct 19, 2012 at 11:31 AM, Chris Muller <ma.chris.m at gmail.com> wrote:

> >> I have an image which needed to allocate 500MB of memory for a large
> >> operation.  Now that operation is done and all objects have been
> >> reclaimed.  According to VM I am now only using 200MB.
> >>
> >>   (Smalltalk vmParameterAt: 2) max: (Smalltalk vmParameter at: 1)
> >> "221923374"
> >>
> >> However, when I look at my VM process in "top" or the System Monitor,
> >> it still says its >500MB.
> >>
> >> How does this work?
> >
> > Depends on the platform.  On Mac OS X memory is not returned. On Windows
> > memory is allocated and freed via VirtualAlloc and VirtualFree.  On Unix
> > memory is allocated and returned via mmap and munmap by default.  What OS
> > are you on?  Looks like the unix code could be ported to the Mac easily.
> Linux chrisT520 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09
> UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
> So, after several hours top still shows >500MB.  Will it ever go back
> down to the level reported by vm-parameters [1,2 or 3]?

I'm not sure.  It all depends on the useMmap variable in the linux vm.  If
it is non-zero then a cursory reading of the source says that yes, the
memory should be returned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20121019/4159dc37/attachment.htm

More information about the Vm-dev mailing list