[aida] Reclaiming Memory in Aidaweb

Janko Mivšek janko.mivsek at eranova.si
Mon Oct 25 09:57:13 CEST 2010


Hi Herbert,

Here is a method as an extension of SwazooServer in BiArt (also in
Scribo) for hourly backup but also hourly and nightly cleanup of session
application state on 6.x Aida:

SwazooServer>>watchdogOther

  self isNewHour ifTrue:

    [WebSessionManager allInstances do:
	[:each | each removeNonactiveGuestSessions].
    [(Delay forSeconds: self watchdogPeriod) wait.
    self imageBackupAndSnapshot]
	fork ].

   self isNightlyBackupTime ifTrue:

     [HTTPConnection allInstances do: [:each | each close].
     WebSessionManager allInstances do:
       [:each | each removeGuestSessions].
     WebSessionManager allInstances do:
       [:each | each releaseApplicationState].
    (Delay forSeconds: self watchdogPeriod) wait].


Note specially the new method:

	WebSessionManager>>releaseApplicationState

This method now do a really detailed cleanup of sessions, it clears all
instances of Apps, but also nils last requests etc. The same goes with
methods #removeGuestSessions and #removeNonactiveGuestSessions.

I namely also had similar problems for a while but with this patch now I
manage to control session state successfully.

BTW: I came to the root of the problem exactly as Mariano suggests, just
on VW which has a very good inspector for such undertakings. It seems
that a new Pharo inspector is a good step in that direction too.

Best regards
Janko

On 24. 10. 2010 22:40, Herbert König wrote:
> Hi,
> 
> In my trunk image I have a lot of objects I can't get rid of.
> I believe when the server is stopped (SwazooAida demoStop)
> I should have 0 HTTPRequest subInstances.
> In my 3.8 Image I have 2 in Trunk I have 791.
> Same numbers in both Images for SwazooTask.
> 
> Also I have 1 Instance of HTTPServer in 3.8 while I have 8 in my trunk
> image.
> 
> What should be the numbers for those classes and how to get rid of of
> the many instances in trunk?
> 
> Basically I took a trunk image (Cog), updated it to 10606, loaded Sport,
> Swazoo, Aida and then my app and started playing.
> 
> Another question:
> Janko, which measures where taken to keep the memory of Squeak.org
> low? I refer to the discussion with Ken on Squeak dev.
> 
> 
> Thanks,
> 
> Herbert                          mailto:herbertkoenig na gmx.net
> 
> _______________________________________________
> Aida mailing list
> Aida na aidaweb.si
> http://lists.aidaweb.si/mailman/listinfo/aida
> 

-- 
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si


More information about the Aida mailing list