I'm looking for empirical evidence to support using using Open J9's class data sharing feature. This feature claims to:
offer transparent and dynamic sharing of data between multiple Java virtual machines (JVMs) running on the same host, which reduces the amount of physical memory consumed by each JVM instance
I'm using docker compose to run 5 copies of the same application and a local prometheus server to monitor memory usage in all 5 JVM's.
I've run with the class data sharing feature enabled and with it disabled and then I'm looking at metrics.
- jvm classes loaded
- jvm nonheap memory
- jvm class storage
- jvm JIT data cache
- buffer memory
which were all exposed in a spring boot application via the Prometheus actuator endpoint.
My intuition told me that if some memory mapped file was being used for class storage I might see some reduction of the amount of class storage and non-heap memory being used.
It's not that my test is hugely scientific, but so far I've see the opposite - when I enable the feature both of these metrics slightly go up (marginal amounts but not at all down).
Where should one really be looking to measure the impact that this feature has. On the surface it feels to me like it should have some measurable impact given that all 5 apps are identical which makes me feel I'm measuring the wrong thing(s).