I am developing a web app. In that app, I am maintaining huge data map in the session
Well, that's maybe not a that good idea, especially if you keep data in the session for a long time:
- this won't scale well if you increase the number of concurrent users.
- this would have a huge cost in a clustered environment with persistent sessions (this might not be the case here but keep it in mind).
An alternative would be to write the data to a database.
How to increase the heap space?
Use the -Xmx
JVM option to set the max heap space. For example, -Xmx512M
. With Tomcat, you are supposed to set the JVM options in the CATALINA_OPTS
environment variable (I'd set it in catalina.bat). See this blog post.
Is there any tool to monitor the session values?
Lambda Probe can do this (see the changelog).
See also