[squeak-dev] lowSpaceWatcher problems

Chris Muller asqueaker at gmail.com
Tue Mar 12 21:58:31 UTC 2013


Yes, a polling approach is something I've used in the past.  I wanted
to get away from it but may have to go back to that..

On Tue, Mar 12, 2013 at 6:03 AM, Bob Arning <arning315 at comcast.net> wrote:
> You can always construct something in Smalltalk to do more of what you want:
>
> makeSpy
>
>     | memoryEnd params |
>
>     spy _ [
>         [pig isTerminated] whileFalse: [
>             params := Smalltalk getVMParameters.
>             memoryEnd            := params at: 3.
>             memoryEnd > 400000000 ifTrue: [
>                 Processor remove: pig ifAbsent: [self halt].
>                 pig debugWithTitle: 'Interrupted from SpaceSpy'.
>                 self halt.
>             ].
>             (Delay forMilliseconds: 60) wait.
>         ].
>         'The pig was terminated ',Time now asString,'   ' displayAt: 0 at 20.
>     ] newProcess.
>     spy priority: 45; resume.
>
> In this case, as long as the suspect process is running, the spy checks
> periodically for above-normal memory use, terminating the pig when reached.
>
> Cheers,
> Bob
>
> On 3/11/13 9:51 PM, Chris Muller wrote:
>
> I have a server performing a heavy-lift operation crash with "out of
> memory".  Investigation revealed the lowSpaceWatcher did not give any
> of its #memoryHogs a chance to #freeSomeSpace because it the VM
> actually ran out of memory just prior to that -- during the initial GC
> (called from #bytesLeft).
>
> I notice #lowSpaceThreshold is only 400K which seems like a very
> insignificant amount of memory by 2013 standards, so I upped it
> 10-fold to 4M:
>
>    lowSpaceThreshold
>          ^ 4000000
>
> My thought was that this would cause the VM to signal the
> LowSpaceSemaphore, when only 4M was remaining rather than when there
> was only 400K remaining.  I'm allocating 700M to the server, so a
> LowSpace signal at 696M is absolutely fine!
>
> Unfortunately, the 4M threshold seems to create all sorts of strange
> slowness and... problems, I guess.
>
> I need lowSpaceWatcher to work, what is the proper way to fix this?
>
>
>
>
>
>


More information about the Squeak-dev mailing list