[Vm-dev] Setting minimum time threshold before freeing memory?

Phil B pbpublist at gmail.com
Sat Mar 21 06:36:10 UTC 2020


Eliot,

On Sat, Mar 21, 2020 at 12:53 AM Eliot Miranda <eliot.miranda at gmail.com>
wrote:

>
> Hi Phil,
>
>
> > On Mar 20, 2020, at 10:57 AM, Phil B <pbpublist at gmail.com> wrote:
> >
> > 
> > I've been noticing at times that the VM seems to churning a bit re:
> allocating and freeing memory.  Granted, this is due to the workload I'm
> throwing at it (i.e. periodically perform a task that creates a number of
> Forms which are short-lived, for example) but it seems a tad aggressive on
> the free side.  What I'm wondering is if there's a VM parameter to slow
> down the rate at which it will free up memory? (i.e. alloc whenever needed,
> but free no sooner than X seconds after the last alloc)
>
> There are two main parameters.  One is the size of eden.  Make this 64Mb
> (default 4mb 32-bits, 8Mb 64-bits).  The second is the GC growth ratio
> (can’t remember the name but it is assigned in setGCParameters).  This
> determines how much growth in heap size there is before a full GC kicks
> in.  If your usage is bursty then setting this high is probably a good idea.
>

Is the 'survivor count tenuring threshold' (parm 6) the other one you're
referring to? (If so I'm not familiar with it... can you point me to
'David's paper' referred to in the method comment?)

More info about my setup in case it helps:  A while back (several years
ago) I started modifying my images to use the following values:

Smalltalk
    vmParameterAt: 24
    put: 268435456;

    vmParameterAt: 25
    put: 134217728;

    vmParameterAt: 45
    put: 67108864.

It used to be the next time I'd restart my image after saving, those
settings would work.  However the VM (5.0-202002190233) doesn't seem to be
taking two of these settings anymore.  Not sure when it changed/broke, but
currently despite the above settings the image reports:

Smalltalk vmParameterAt: 24. "33554432"
Smalltalk vmParameterAt: 25. "16777216"
Smalltalk vmParameterAt: 45. "67108864"
Smalltalk vmParameterAt: 44. "49546912"

The VM does appear to be doing an alloc/free of 16MB every couple/few
seconds when it gets into this state.

So it looks like I have two problems:

1) The VM appears to no longer take my memory threshold/headroom settings.
Are these values now too large or are there now other parms I need to
change related to these settings? (i.e. are these still the right settings
to be fiddling with?)

2) In the event that the VM is right at the edge of needing more memory
(briefly), the VM allocs/frees blocks of RAM continuously.  Is VM parm 6
the right setting to tweak to try to minimize this? (if so, seems like a
tough value to get right for  workloads where the object sizes can shift
around depending on what the image is doing)


> HTH
>
> _,,,^..^,,,_ (phone)


Thanks,
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200321/232c664f/attachment.html>


More information about the Vm-dev mailing list