Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 566261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:57:31+00:00 2026-05-13T12:57:31+00:00

We are running into unusually high memory usage issues. And I observed that many

  • 0

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

I am using JRockit 1.5 and 1.6GB of RAM. I did profiling with Jprobe and found that some parts of app have very heavy memory footprint. Most of this data is being into session to be used later.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:57:31+00:00Added an answer on May 13, 2026 at 12:57 pm

    That depends entirely on how many sessions are typically present (which in turn depends on how many users you have, how long they stay on the site, and the session timeout) and how much RAM your server has.

    But first of all: have you actually used a memory profiler to tell you that your “high memory usage” is caused by session data, or are you just guessing?

    If the only problem you have is “high memory usage” on a production machine (i.e. it can handle the production load but is not performing as well as you’d like), the easiest solution is to get more RAM for the server – much quicker and cheaper than redesigning the app.

    But caching entire result sets in the session is bad for a different reason as well: what if the data changes in the DB and the user expects to see that change? If you’re going to cache, use one of the existing systems that do this at the DB request level – they’ll allow you to cache results between users and they have facilities for cache invalidation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into a common pattern in the code that I'm writing, where I
Running into a problem where on certain servers we get an error that the
I'm running into a mental roadblock here and I'm hoping that I'm missing something
We're running into issues with how we specify font sizes. If we specify the
I'm running into an issue with a join: getting back too many records. I
I've look all over, but keeps running into same info that talks about directory
I'm writing some code for activating neural networks on CUDA, and I'm running into
Hey php gurus. I'm running into some bizarre class scope problems that clearly have
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
I'm running into an issue where I have a FileUpload control in an UpdatePanel.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.