Wrong size of the session attribute is shown when using ZK library
Brought to you by:
cedrik_lime
When using ZK library in our application and using the MessAdmin to check the session consumption, found out the attribute "javax.zkoss.zk.ui.Session" for each single session use hundreds of MB (~180MB).
After using the some 3rd party memory profiler to check the memory consumption, found out that the org.zkoss.zk.ui.http.SimpleSession only use 240 bytes.
Further on the investigation,
1. ZK's session implementation org.zkoss.zk.ui.http.SimpleSession have a field _navsess to store native session of web container.
2. MessAdmin's object size algorithm will loop each fields inside the object, which will cause recursive calculation for org.zkoss.zk.ui.http.SimpleSession