DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCJPA-279
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: Brendan Humphreys
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus API JPA

JPAQuery.setHint("javax.persistence.loadgraph", graph) leaks FetchPlans.

Created: 22/Aug/14 11:14 AM   Updated: 19/Nov/14 11:49 AM   Resolved: 19/Nov/14 11:44 AM
Component/s: API
Affects Version/s: 4.0.1
Fix Version/s: None

Severity: Production

 Description  « Hide
I believe there is a memory leak associated with the use of {{JPAQuery.setHint("javax.persistence.loadgraph", graph)}}.

The FetchGroupManager associated with the PersistenceNucleusContext accumulates FetchPlans as planListeners; they aren't deregistered on entityManager.close()

I've created a failing testcase here:

This means a FetchPlan is leaked every time a query using an entityGraph is executed.

Brendan Humphreys added a comment - 22/Aug/14 11:28 AM - edited
This is hitting us in production, as can be seen by the following chart:

Andy Jefferson added a comment - 22/Aug/14 12:51 PM
If its hitting you in production then I strongly suggest you get the code (GitHub) and work out the problem.

Brendan Humphreys added a comment - 22/Aug/14 01:21 PM
Thanks Andy,

As it happens we reboot service nodes with enough regularity that this issue hasn't derailed us yet. I haven't had a chance to dig into the DN codebase to see where a fix might be applied, but a viable workaround is to reset the FetchPlan manually after it has been executed:


Andy Jefferson made changes - 22/Aug/14 02:31 PM
Field Original Value New Value
Priority Critical [ 2 ] Major [ 3 ]
Andy Jefferson added a comment - 19/Nov/14 11:44 AM
Can't reproduce using GitHub master

Andy Jefferson made changes - 19/Nov/14 11:44 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 19/Nov/14 11:49 AM
Status Resolved [ 5 ] Closed [ 6 ]