Issue

AEM crashes with or without an OutOfMemoryError. Leak suspects report from Eclipse Memory Analyzer Tool (MAT) shows org.eclipse.jetty.server.session.HashedSession consuming most of the heap. 

Example output from Eclipse MAT:

1,650,055 instances of "org.eclipse.jetty.server.session.HashedSession", loaded by "org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x6c279ad00" occupy 2,292,147,984 (51.04%) bytes. These instances are referenced from one instance of "java.util.concurrent.ConcurrentHashMap$Node[]", loaded by ""

Keywords
java.util.concurrent.ConcurrentHashMap$Node[]
org.eclipse.jetty.server.session.HashedSession
org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x6c279ad00

Environment

AEM 6.0, 6.1

Cause

It is a known issue fixed in AEM6.2.  Jetty sessions had no default time out configured in AEM6.0 and 6.1.

Resolution

  1. Go to http://host:port/system/console/configMgr/org.apache.felix.http

  2. Set a reasonable value under Session Timeout

  3. Save