[Celerity-users] memory leaks and serialize blockage
jason franklin-stokes
jasoninclass at googlemail.com
Thu Dec 10 11:05:00 EST 2009
Hi Jari,
I have localized the problem down to two methods:
add_listener in the Lister class and
click_and_attach in the Browser class
I have removed / replaced the use of these two methods from my code and I have no more loose threads or memory leaks and i get the serialization of webclient to work properly.
i obviously need the listeners and the click_and_attach method (i only use this method of clicking something).
i will try an come up with a stable reproduction of the problem and let you know as soon i have that.
best 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