Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » Incorrect(?) retained heap for com.google.common.base.Optional
Incorrect(?) retained heap for com.google.common.base.Optional [message #1234658] Wed, 22 January 2014 13:53 Go to next message
Lars Oppermann is currently offline Lars OppermannFriend
Messages: 2
Registered: January 2014
Junior Member
Hello everyone,

While debugging a memory problem I found a leak where some domain objects pile up in a HashMap. The domain objects are wrapped in a com.google.common.base.Optional (google guava library) and the value fields of the HashMap$Entry instances are of type com.google.common.base.Optional$Present.

The retained heap for the reference field in those instances shows correctly as 6,750,112 bytes. However, this is not added to the retained heap of the HashMap or any other instances further up the object tree in which it is included.

In this case, it was pretty easy to find these objects since they are relatively large (> 6MB), but in scenarios where the individual instances are much smaller and just much more numerous, I wasn't able to see the problem because the where not attributed to the retained heap.

Here is a (redacted) screenshot showing the situation for one of the 700+ HashMap entries. All of the entries include a similar value:
index.php/fa/17310/0/

Am I wrong in expecting that these "com.foo.bar.LargeDomainObject" instances should normally be part of the retained heap of the containing HashMap?

Cheers,
Lars
Re: Incorrect(?) retained heap for com.google.common.base.Optional [message #1237357 is a reply to message #1234658] Wed, 29 January 2014 13:52 Go to previous message
Lars Oppermann is currently offline Lars OppermannFriend
Messages: 2
Registered: January 2014
Junior Member
So to answer my own question, it seems like a retained vs. referenced set thing. The objects in question where referenced from the cache and from the place where they were actually used thus, neither of those two places "retained" the object and it wasn't attributed to any retained set.
Looking at other discussions such as http://www.eclipse.org/forums/index.php/t/553734/ explain this very well.
Previous Topic:Memory Analyzer 1.3.1 Released
Next Topic:user classes in MAT
Goto Forum:
  


Current Time: Fri Apr 19 04:17:49 GMT 2024

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

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

Back to the top