[
https://issues.apache.org/jira/browse/OPENJPA-2566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14294109#comment-14294109
]
brian yoder edited comment on OPENJPA-2566 at 1/27/15 8:16 PM:
---------------------------------------------------------------
I removed the lines of code that cast the EM and set fetch group. No leak, so
I am nearly confident that the fetch group is the issue. I am setting the
fetch group on every EJB method invocation, assume that is OK. Will attach a
heap dump screenshot. It should be noted that I am using JMeter to hit the
server for load testing, so that is how I found the issue.
I suspect there are downstream affects of setting the fetch group for the EM,
and it would be my guess that there are artifacts left over that are not
cleared up when the EM commits or rollsback. If you wish I can add some
em.clear or something to see if it helps. Just let me know.
was (Author: byoder):
I removed the lines of code that cast the EM and set fetch group. No leak, so
I am nearly confident that the fetch group is the issue. I am setting the
fetch group on every EJB method invocation, assume that is OK. Will attach a
heap dump screenshot. It should be noted that I am using JMeter to hit the
server for load testing, so that is how I found the issue.
> Memory leak when using addFetchGroup?
> -------------------------------------
>
> Key: OPENJPA-2566
> URL: https://issues.apache.org/jira/browse/OPENJPA-2566
> Project: OpenJPA
> Issue Type: Bug
> Affects Versions: 2.3.1
> Reporter: brian yoder
> Attachments: screen shot OOM.jpg
>
>
> I have noticed a memory leak when using the following code on Glassfish J2EE
> server 3.1, however suspect the issue is not related to Glassfish.
> OpenJPAEntityManager kem = OpenJPAPersistence.cast(emNoTran);
> kem.getFetchPlan().addFetchGroup("contactDetails");
> It seems the code causes a huge memory leak with JDBCBrokerFactory growing
> its MapBackedSet, ConcurrentHashMap.
> Any ideas why this would be? I am calling the above code over-and-over again
> for each EJB method invocation, which it was my understanding it is only good
> for the current EM transaction. Perhaps I have misunderstood.
> My Requirement is to set the fetch group only for the current transaction,
> such that lazy fields for a particular entity get loaded up front, but only
> within this call from the EJB.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)