<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">You can always construct something in Smalltalk
      to do more of what you want:<br>
      <br>
      makeSpy<br>
      <br>
      &nbsp;&nbsp;&nbsp; | memoryEnd params |<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; spy _ [<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [pig isTerminated] whileFalse: [<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; params := Smalltalk getVMParameters.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; memoryEnd&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; := params at: 3.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; memoryEnd &gt; 400000000 ifTrue: [<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Processor remove: pig ifAbsent: [self halt].<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pig debugWithTitle: 'Interrupted from
      SpaceSpy'.&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self halt.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (Delay forMilliseconds: 60) wait.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'The pig was terminated ',Time now asString,'&nbsp;&nbsp; '
      displayAt: 0@20.<br>
      &nbsp;&nbsp;&nbsp; ] newProcess.<br>
      &nbsp;&nbsp;&nbsp; spy priority: 45; resume.<br>
      <br>
      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.<br>
      <br>
      Cheers,<br>
      Bob<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 3/11/13 9:51 PM, Chris Muller wrote:<br>
    </div>
    <blockquote
cite="mid:CADTxDUgGktfd5CSAB7yqOEmQ7GNboqS4kUCEaxJ73t9pu4y-oQ@mail.gmail.com"
      type="cite">
      <pre wrap="">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?


</pre>
    </blockquote>
    <br>
  </body>
</html>