During stress test of asset search of asset share commons [1], a memory leak or unresolved object issue happened.
Steps to reproduce:
-
# ab -n 100 -c 1 -A admin:admin "http://localhost:4502/content/asset-share-commons/en/light/searchtestpage.html?layout=card&p.offset=0&p.limit=24"
# jcmd 1810 GC.class_histogram | grep AssetResult 505: 169 6760 com.adobe.aem.commons.assetshare.search.results.impl.result.AssetResultImpl
# jcmd 1810 GC.class_histogram | grep AssetResult 189: 1608 64320 com.adobe.aem.commons.assetshare.search.results.impl.result.AssetResultImpl
A heap dump analysis tells a suspect is org.apache.sling.models.impl.ModelAdapterFactory loaded by org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 [2].
- https://github.com/Adobe-Marketing-Cloud/asset-share-commons
- One instance of "org.apache.sling.models.impl.ModelAdapterFactory" loaded by "org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x9749d5d0" occupies 1,528,764,960 (78.49%) bytes. The memory is accumulated in one instance of "org.apache.sling.models.impl.ModelAdapterFactory" loaded by "org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x9749d5d0".
Keywords
org.apache.sling.models.impl.ModelAdapterFactory
org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x9749d5d0
There was a problem in Asset Share Commons. The QueryBuilder search creates unclosed ResourceResolver.
Update Asset Share Commons to version 1.1.4 or later.