How much data can I store in Java Session?

advertisements

We are working in a Tomcat/J2EE application.

In this application we store a lot of data in the session, and I'm wondering how many data can we store with no problems.

What is the minimum restriction? The memory of Tomcat? The JVM?

How can I calculate if I can store it 200k strings?


For #1 - You can store as much data as heap size allocated to JVM. Of course, tomcat runs inside the JVM so it will also use some part of the memory allocated.

For #2 - It really depends on the size of the string - 2 bytes are required per unicode character. Take the average size of your string, multiply it by 200k and then make sure you have enough memory allocated.