[Celerity-users] memory leaks and serialize blockage

Jari Bakken jari.bakken at gmail.com
Thu Dec 10 09:52:58 EST 2009


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)


More information about the Celerity-users mailing list