Hi, I'm running a v4.2.0 on a Tomcat 7.0.64 with 1GB of max Heap space.
I've no problems for years, but in last weeks it ran in out of memory almost once a day.
I took some heap dump and made some tests, and I found the class resposible of memory retention:
org.alfresco.repo.webservice.repository.RepositoryQuerySession
Every time a document is saved in Alfresco by a thirdparty software (via WS), two new instances of RepositoryQuerySession are created in memory, and never removed.
And these objects retains op to 5MB each.
GC is called but they stay there.
The problem does not apper when documents are uploaded throgh Alfresco web interface.
Unfortunatly I've no acces on that thirdparty sotware.
So what could keep alive these RepositoryQuerySession objects?
Instances of RepositoryQuerySession are retained within the Repository 2nd-level cache named "webServicesQuerySessionSharedCache", which can be configured via the alfresco-global.properties file. By default, the cache allows up to 1000 objects to be cached. Cached objects are not cleared during GC, so it is important to correctly configure the cache sizes when using extremely little memory (1GiB max heap is extremely little for Alfresco).
Thanks a lot Axel
I set
cache.webServicesQuerySessionSharedCache.maxItems=50
in my alfresco-global.properties and it actually works: the number of RepositoryQuerySession instances grows up to 50 and never exceeds it.
One more question.
I tried also to set
cache.webServicesQuerySessionSharedCache.timeToLiveSeconds=240
cache.webServicesQuerySessionSharedCache.maxIdleSeconds=120
but they seems not applied.
After 2 or 4 mintue of inactivity, my RepositoryQuerySession instances are still present in heap.
Maybe these parameters are not supported in my alfresco version (4.2.0)?
Yes, some configuration operations are not supported for all Alfresco versions / editions. There also is a difference if the cache in question is created as a local-only or a cluster-distributed cache in Alfresco Enterprise. In 4.2, timeToLive and maxIdle weren't used for local caches.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.