Extremely high JVM Heap Memory Usage
Hi,
as background I'm fairly new to AEM and have to look into this platform that has been around at the company for over 5 years and changed ownership a couple of times. To me it's a bit of a black box. I have read all the Adobe documentation regarding the architecture of AEM, Hardware Sizing Guidelines, Performance Tuning Tips etc.
What struck me is that our instances (both author and publisher) are insanely large (122 GB RAM), which seems excessive to me considering what the platform is doing. If I go by the sizing guideline it recommends around 2G JVM heap memory. I found some IaC templates on Github that deploy an AEM stuck and their defaults have 4/8 GB as min/max JVM heap.
I created a heap dump and loaded it in VisualVM and it's 95% bloated up with String class instances over 100 Mio instances taking up over 30 GB. After calculating references and following them through some referenced hash maps they have some Lucene PropertyIndex as root. I read up a bit about the Oak repository and Lucene. However, I have a hard time believing that this is normal and the platform needs to keep all of that stuff in memory. It's all just fragments of pages or even complete HTML pages. Millions of them.
When I look at the memory usage of the instance over time it's a rollercoaster. Suddenly it shoots up by 50GB then climbs a bit and stays high for weeks but also falls off the cliff sometimes to still very high levels before shooting up again.
Anyone with some more experience can chime in if that's reasonable and considered normal if you have a repository of a certain size? Any pointers what to look into next?

