Bug 464787 - Memory leak by calling JAXBHelperContext - Leak suspect IdentityWeakHashMap
Summary: Memory leak by calling JAXBHelperContext - Leak suspect IdentityWeakHashMap
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2015-04-16 08:21 EDT by Igor Repka CLA
Modified: 2022-06-09 10:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Repka CLA 2015-04-16 08:21:46 EDT
We have problem with heap memory. In heap dump we can see that 40% of memory is used by org.eclipse.persistence.internal.helper.IdentityWeakHashMap. We call org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext (methods wrap and unwrap) from our code. IdentityWeakHashMap is growing in memory all the time till OutOfMemoryException occurrence or server restart.

Our architecture:

We work with SDO objects in our system so we need to use JAXBHelperContext for transformations from / to POJO. Object of JAXBHelperContext is implemented as instance variable in Singleton class - so there is only one instance of JAXBHelperContext in our system. 

We were expecting that GC will be able to delete unneeded instances from IdentityWeakHashMap but according to our performance tests this is not happening. We do not do anything special in persistence logic - just return data or store data - so we do not keep references on objects - we use local scope (objects exists only inside the method).

We tried to change implementation and remove JAXBHelperContext from singleton, after that there was not problem with heap anymore. But it has negative impact on our architecture (performance).  

We use Websphere Application Server v7.
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:30:04 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink