[Celerity-users] memory leaks and serialize blockage
jason franklin-stokes
jasoninclass at googlemail.com
Thu Dec 10 14:19:17 EST 2009
Jari,
just thinking about without looking at the code again...
click_and_attach is probably thowing away the old instance of the webclient while the javascipt thread is still running which means that it wont get garbage collected. closeallwindows needs to be called on the webclient instance to ensure that the javascript threads get terminated. I am just not sure what side effects that would have on the celerity code by calling close on the celerity browser instance before letting it go in click_and_attach.
what do you think?
jason.
On Dec 10, 2009, at 3:52 PM, Jari Bakken wrote:
> On Wed, Dec 9, 2009 at 11:58 PM, jason franklin-stokes
> <jasoninclass at googlemail.com> wrote:
>>
>> what exactly is this method for? is there another way of doing this so that it does hold objects in memory and does not get in the way of serialize?
>>
>
> Celerity listens for web window events so that it knows when the page
> has changed, and can update its internal @page reference accordingly.
> So it's pretty important. I'm not aware of another way to do this
> without breaking tests, e.g. pages like this:
>
> http://github.com/jarib/watirspec/blob/master/html/timeout_window_location.html
>
> If you can provide some code that shows this is the source of a memory
> leak, I'll be happy to work on it. Without some way of
> testing/observing, I'll just be wandering in the dark.
>
> If you think the Celerity::Listener class is at fault, you can try
> this and see if the situation improves:
>
> def enable_event_listener
> @webclient.addWebWindowListener do |event|
> self.page = @page ? @page.getEnclosingWindow.getEnclosedPage :
> event.getNewPage
> end
> end
>
> About the serialization issue:
>
> When we add a Java interface implementation written in JRuby as a
> listener to the WebClient, it's no longer serializabe. This is because
> JRuby's interface implementations are not serializable. I've explained
> this before:
>
> http://rubyforge.org/pipermail/celerity-users/2009-September/000175.html
>
> You should be able to serialize the WebClient/page after removing the
> event listener:
>
> listener = browser.send :listener
> c.webclient.removeWebWindowListener(listener)
> _______________________________________________
> Celerity-users mailing list
> Celerity-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/celerity-users
More information about the Celerity-users
mailing list