Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-tm-dev] Possible memory leak in AbstractHostShellOutputReader

Hi Patrick,

Could you open a bug for this?

Here's a link to bugzilla:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Target%20Management

Thanks,
____________________________________
David McKnight
Phone: 905-413-3902 , T/L: 969-3902
Internet: dmcknigh@xxxxxxxxxx
Mail: D1/YFY/8200/TOR
____________________________________

Inactive hide details for Patrick Tassé <patrick.tasse@xxxxxxxxx>Patrick Tassé <patrick.tasse@xxxxxxxxx>


          Patrick Tassé <patrick.tasse@xxxxxxxxx>
          Sent by: dsdp-tm-dev-bounces@xxxxxxxxxxx

          30/01/2009 03:23 PM

          Please respond to
          Target Management developer discussions <dsdp-tm-dev@xxxxxxxxxxx>

To

Target Management developer discussions <dsdp-tm-dev@xxxxxxxxxxx>

cc


Subject

[dsdp-tm-dev] Possible memory leak in AbstractHostShellOutputReader

Hi,

I am using a SshHostShell in my application. For some reason, I cannot exit this shell at any time or else the target closes the whole connection. I suspect that my target node has a bad implementation of ssh, and it closes the session whenever you try to disconnect a channel of type "shell". It doesn't do that when you close a channel of type "sftp" for example.

Because of this, I keep the same SshHostShell for the whole duration of the target connection, and use writeToShell() to send commands and get the results from the standard output reader which is SshShellOutputReader, an extension of org.eclipse.rse.services.shells.AbstractHostShellOutputReader.

After some time, my application runs out of heap space. What happens is that the ArrayList _linesOfOutput in AbstractHostShellOutputReader only gets items added to it, it is never cleaned up of old lines. It can have hundreds of thousands of elements.

The ArrayList is read using HostShellChangeEvent.getLines(). It appears that all IHostShellOutputListener no longer need the event (and therefore, the lines) once they have processed it with shellOutputChanged(), but I don't know if this is a rule.

Could the ArrayList be cleaned up after firing the event to all the listeners? Or do we even need an ArrayList at all? From the source code, it looks like it was originally designed to allow firing events with a range of lines, but then was changed to fire an event with only a single line at a time.

Thanks,
Patrick
_______________________________________________
dsdp-tm-dev mailing list
dsdp-tm-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tm-dev

GIF image

GIF image

GIF image


Back to the top