Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Memory Leak issue in GEF Module(Memory Leak issue in GEF Module)
Memory Leak issue in GEF Module [message #1818758] Fri, 27 December 2019 11:06 Go to next message
girijanandan nucha is currently offline girijanandan nuchaFriend
Messages: 25
Registered: January 2019
Location: Bangalore, India
Junior Member
Hi All,

I am facing following issue.
I have an product which is based out of eclipse. I am using GEF 5.1.0 for few features.
I am observing that, even after javaFx application is closed, memory for the view components is not released by JVM. And on subsequenet operations, memory piles up.

Please help me how to go about fixing this.

Thanks and Regards,
Giri
Re: Memory Leak issue in GEF Module [message #1819253 is a reply to message #1818758] Fri, 10 January 2020 14:17 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Giri,

it would help a lot if you could trace down the memory leak, i.e. find specific references not cleared.

I do know that some places in the codebase might be leaking, e.g. the adaptable scope mechanism maintains a static map that cannot be cleared.

Usually, however, memory leaks have got to do with references to model elements. Those might be coming from JavaFX event handlers not being removed.

You should be able to track it down using a memory analyzer/profiler, e.g. YourKit or VisualVM, looking for your model elements (large memory footprint).

Best regards,
Matthias
Re: Memory Leak issue in GEF Module [message #1821944 is a reply to message #1819253] Mon, 24 February 2020 09:14 Go to previous messageGo to next message
girijanandan nucha is currently offline girijanandan nuchaFriend
Messages: 25
Registered: January 2019
Location: Bangalore, India
Junior Member
the picture gc_root.png shows the jvisualvm gc root tells who is holding the reference of javafx objects(like ).
com.sun.javafx.geom.RectBounds,
javafx.beans.property.SimpleObjectProperty, Node, BoundingBox, etc..

From the gc root all these are referenced from scopedInstances of
org.eclipse.gef.common.adapt.inject.AdaptableScope class.

Please help me to get around this issue.
Re: Memory Leak issue in GEF Module [message #1822390 is a reply to message #1821944] Thu, 05 March 2020 12:59 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Girijanandan,

the keys in this map are weakened. Therefore, entries should be removed when they get garbage collected.

Since there is still a visual registered in visual-part-map, the viewer does not seem to be properly disposed. Disposal sets the adaptable-property of all adapters (that are adaptable-bound) to null. As soon as a part (adaptable-bound) loses its viewer (adaptable), it will unregister from its old viewer.

Therefore, I believe there should be some underlying issue preventing disposal, or an error w.r.t. unregistration, or something else.

I know it is hard, but I believe you need to dig deeper.

Some things to try:

1) When closing the visualisation, ensure that contents are cleared and viewer is disposed. Investigate state of visual-part-map, content-part-map, and viewer models (e.g. selection model). You should hopefully know more after doing this.

2) In a memory snapshot, try to follow reference chains to find root causes preventing garbage collection. Candidates for this are registered event handlers referencing model data (or a chain leading to model data).

If you have more insights to share, please do!

Best regards,
Matthias
Re: Memory Leak issue in GEF Module [message #1823269 is a reply to message #1822390] Tue, 24 March 2020 06:03 Go to previous message
girijanandan nucha is currently offline girijanandan nuchaFriend
Messages: 25
Registered: January 2019
Location: Bangalore, India
Junior Member
Hi Matthias,

Sorry for the delayed reply.
As you correctly pointed out there was 1 viewer reference which was not cleared in the previous gc_root image that i posted.
Now, I cleared the viewer refernce, but still the issue persists.

Please refer attached gc_root image after viewer cleared.

Thanks,
Giri
  • Attachment: gc_root.JPG
    (Size: 74.95KB, Downloaded 53 times)
Previous Topic:SpaceTreeLayoutAlgorithm fails when node count is high
Next Topic:Unhandled Exceptions
Goto Forum:
  


Current Time: Tue Sep 27 02:49:28 GMT 2022

Powered by FUDForum. Page generated in 0.01964 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top