https://forum.world.st/Aida-6-4-problem-with-Ajax-HTML5-based-application-tp4641846p4642310.html
thank you very much for your post. It looks very useful and I'll try to use some of yours code.
>>
> Hi Martin,
>
> when I test my app with Selenium from 5 browsers at the same time I quickly have 300000 subInstances of WebElement and 500MB Ram filled up. And guess what, responses get slow :-))
>
> To keep a grip on memory I do what you find below. Copy it into a Workspace to get it syntax highlighted.
> This is still very experimental and some may be unnecessary. But if I run it with the selenium tests memory consumption stops at 120 MB and keeps responses much faster. Because my tests always create a new model and a new app for it, this expires the sessions after 15 minutes.
>
> Please be careful when trying!!
>
> Cheers,
>
> Herbert
>
> [10000 timesRepeat: [
> Smalltalk garbageCollect.
> "some Diagnostics"
> Transcript cr; show: Process allInstances size asString; show: ' '; show: Semaphore allInstances size asString; show: ' '; show: HTTPConnection allInstances size asString.
> (Delay forSeconds: 10) wait.
> "Connections piled up"
> HTTPConnection allInstances do: [:each| each isOpen ifFalse: [each server notNil ifTrue: [each server removeConnection: each]. each loop: nil; server: nil]].
> SwazooTask allInstances do: [:each| each connection ifNotNil: [each connection stream ifNil: [each connection: nil; request: nil; response: nil]]].
> (Delay forSeconds: 10) wait.
> "This is where I release my application state. Application state is small but only then the WebElement subinstances go away."
> EllingWebTabsApp allInstances do: [:each| each session ifNotNil: [each session isActive ifFalse: [each actionLogoutLogoff]]].
> SwazooStream allInstances do: [:each| each socket isActive ifFalse: [each close]].
> "Dunno why this helps"
> Process allInstances do: [:each| (each isTerminated and: [each suspendedContext isNil not]) ifTrue: [each suspendedContext receiver: nil. each suspendedContext: nil]]. "??????"
> ]
> ] fork
>
>
> This is how I release my application state:
> actionLogoutLogoff
> self site urlResolver removeObject: self observee.
> self site urlResolver removeObject: rebDownloader.
> rebDownloader content: nil.
> rebDownloader := nil.
> uploadedStream := nil.
> self redirectTo: '
http://www.heise.de'. "umbiegen auf Startseite"
> "Didn't yet try to do this at once, so I forked it for later"
> [(Delay forSeconds: 10) wait.
> WebSessionManager default removeSession: self session.
> (self session) initialize; initOther.
> self observee releaseState. "Maybe unnecessary"
> self observee: nil.
> self session: nil; initContexts; initOther] fork
> _______________________________________________
> Aida mailing list
>
[hidden email]
>
http://lists.aidaweb.si/mailman/listinfo/aida