I've eclipselink v 2.5 enabled application running on Wildfly 8.1 the problem I've noticed is the memory increasing after starting the application because there are huge number of instances of the following classes (snapshot of Visaul VM):
org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap$ReferenceCacheKey 13083824 13,083,824 (3.1%) 125,806 (1.4%) org.eclipse.persistence.internal.helper.linkedlist.LinkedNode 3020376 3,020,376 (0.6%) 125,849 (1.1%) org.eclipse.persistence.indirection.IndirectList 916608 916,608 (0.3%) 14,322 (0.2%)
When I manually start GC no change happen for these classes and it continue to increase the total number of instances.
here is an EJB as a sample from my code which shows the way I'm using to access the persistence context:
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import com.sh.entities.Groups;
@Stateless
public class GroupsFacade extends AbstractFacade<Groups> {
@PersistenceContext(unitName = "WebApplication3PU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public GroupsFacade() {
super(Groups.class);
}
public Groups getByGroupName(String name) {
TypedQuery<Groups> query = getEntityManager().createNamedQuery("Groups.findByGroupName", Groups.class);
query.setParameter("groupName", name);
return query.getSingleResult();
}
Do any one know where is the problem and why this happens ?
thanks.