java - How much session data is too much? -


We are running unusually high memory usage issues. And I saw that in many places in our code we are pulling 100 records from DB, packing it into custom data objects, adding it to array list and storing it in session. I want to know what is the upper limit of recommended data in the session. Just like a good practice bad practice

I am using JRokit 1.5 and 1.6 GB RAM. I documented with Jeprobe and found that there are heavy memory footprint in parts of the app. Most of this data is in the later sessions used.

It relies entirely on how many sessions are usually present (which is how many users you have , How long they stay on the site, and depends on the session timeout) and how much is the RAM of your server

But first of all: have you actually used a memory profiler that you Indicates that your "high memory usage" session is due to data, or do you have a Put Uman?

If you have only one problem that is "high memory usage" on the production machine (i.e. this production load can be handled, but you are not doing as well as you want), the easiest solution Getting more RAM for the server - faster and cheaper than giving an app a new look.

But the entire result set caching in session is also bad for a different reason: What if the data changes in DB and the user expects to see that change? If you are going to cache, then use it at the DB request level - they will allow you to cache the results between users and they have the facility of cache invalidation.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -