[Glass] GC on Gems only fired when temp space is over?

Mariano Martinez Peck via Glass glass at lists.gemtalksystems.com
Mon Jun 22 13:22:33 PDT 2015


On Mon, Jun 22, 2015 at 3:09 PM, Dale Henrichs <
dale.henrichs at gemtalksystems.com> wrote:

>
>
> On 06/22/2015 10:36 AM, Mariano Martinez Peck wrote:
>
>
>
> On Mon, Jun 22, 2015 at 2:16 PM, Dale Henrichs via Glass <
> glass at lists.gemtalksystems.com> wrote:
>
>>
>>
>> On 06/19/2015 02:28 PM, Mariano Martinez Peck via Glass wrote:
>>
>
>>  You could schedule a periodic scavenge and mark sweep in your seaside
>> vms ...
>
>
>  How can I do this if above you said *"scavenges and mark sweep are only
> triggered under memory pressure"  ?*
>
>
>> Once an hour or so would make sure that your idle seaside gems are using
>> the bare minimum of memory ... it may tak a mark sweep for the vm to return
>> memory pages ... BTW, I assume that you are running on linux. On the mac
>> the full memory footprint is allocated in memory ...
>>
>>
>  I would love to do that. Any idea how?
>
> These are the methods to use ... and as I mentioned in my last post, the
> "sigabort process" would be a good place to this processing. Here are the
> methods to manually trigger scavenges and mark sweeps ... the last one is
> probably the one you want:
>    System class>>_vmMarkSweep
>    System class>>_generationScavenge
>    System class>>_generationScavenge_vmMarkSweep
>
>
Dale,

Thanks for such methods! Very useful. Now..I have a couple of questions :)

In another email you said:




*--------We really try to make sure that idle gems stay idle and will only
wake up when needed ... but there is at least one restless process that
wakes up every 30 seconds to facilitate the handling of SigAborts ... the
process itself doesn't touch much memory, but if a SigAbort is required
then the gem will also do an abort and page in a bit more memory, but an
abort is pretty inexpensive for a previously idle process ...BTW, this
little "sigabort process" would be a spot where you could add the logic for
running the periodic scavenge and mark sweep:)*
--------

The main question here is....are you that confident that
#_generationScavenge_vmMarkSweep would be so fast that calling it every 30
seconds won't impact much the system performance?  I was thinking about
calling it like...half an hour hahahaha.

Anyway, if I watch the code:

Transcript cr; show: 'New style SigAbort hanlder'.
TransactionBacklog
  addDefaultHandler: [ :ex |
    "Run the abort in a lowPriority process, since we must acquire the
     transactionMutex."
    Transcript cr; show: 'handled sigabort: ', DateAndTime now printString.
    [
      GRPlatform current transactionMutex
        critical: [ GRPlatform current doAbortTransaction ].
      TransactionBacklog enableSignalling ]
        forkAt: Processor lowestPriority.
      ex resume ].
 RepositoryViewLost
   addDefaultHandler: [ :ex |
     GRPlatform current logError: ex description title: 'Lost OT'
shouldCommit: false.
     ex pass ].
TransactionBacklog enableSignalling.

*it is not clear to me how can I hook. *

Also..I was thinking to include it as part of seaside maintenance VM (a new
task) to run every 30 minutes. But then the other question I had is that
from the code/comment of #_generationScavenge_vmMarkSweep it is not clear
to me if it is performed only in the current gem or in all gems. It seems
to me in current gem. So..... I guess I cannot call this from maintenance
VM, can I?


Thanks in advance,


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150622/eb9f7b81/attachment.html>


More information about the Glass mailing list