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

Eliot Miranda eliot.miranda at gmail.com
Fri Oct 19 18:11:58 UTC 2012


Hi Chris,

On Fri, Oct 19, 2012 at 8:46 AM, Chris Muller <asqueaker 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.



-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121019/459ec785/attachment.htm


More information about the Squeak-dev mailing list