Forums Register Login

java heap problem

+Pie Number of slices to send: Send
Hi ALL,

I wanted to know request object will take more heap or session will take heap memory
becaused iam java heap memory problem.


prasad
+Pie Number of slices to send: Send
They both will take the same amount of memory. The issue here is the lifespan. Requests are short lived, and as soon as the request has finished its attributes can be cleaned up immediately. Sessions on the other hand can be active for hours at a time, all the while its attributes are kept in memory. You should therefore use request attributes unless you need them between multiple requests from the same user; a session is the only option in those cases.

As for your memory problem, sometimes web applications simply need a lot of memory, more than your servlet container (Tomcat?) can provide. If this is the case, try increasing the memory the servlet container can use instead.
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 623 times.
Similar Threads
JVM memory allocation
Heap and Stack
Interesting article about JVM performance
File size and Heap space
File size and Performance
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:31:50.