This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes how many data can be set in context ,session ,and request ? 500M is OK ?Thank you! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!" Watch "how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!" New topic
Author

how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!

Yajun Zhan
Greenhorn

Joined: Dec 20, 2003
Posts: 13
how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!
Ellen Zhao
Ranch Hand

Joined: Sep 17, 2002
Posts: 581
what's the kind of your context, session and request ?
Yajun Zhan
Greenhorn

Joined: Dec 20, 2003
Posts: 13
I am now building a wireless service system,the system goal is it can service 500,000 people,our system will provide 10,000 items that can be ordered by custom,and each items can be packed in a low price package.
I am now considering load all our items and package into context when our system get start.and every day , our system will automatic reload all items and package into memory to ensure new items and package that have been build will be available to custom. By this way, the wireless custom do not need to request our database to search his/her interest items or package.
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

I'm moving this to the servlets forum, seeing as though the session and request contexts are used in web applications.
As for your question... I can't see anything in the Servlet Specification that defines the size limit, so I think the size of the request and sesion contexts is application server specific -- also depending on the size of the heap you start your app server with.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Brahim Bakayoko
Ranch Hand

Joined: Aug 29, 2003
Posts: 155
Yes, you can if you have the memory.


SCJP, SCWCD, SCBCD, IBM CSD WebSphere v5, <br />A+, MCP 2000 and 2000 server, CST, and few incompleted certification tracks.<br /> <br />Ivory Coast<br /> <br />Analyze your web Request/Response @ <a href="http://webtools.servehttp.com" target="_blank" rel="nofollow">http://webtools.servehttp.com</a> down for a while...
Yajun Zhan
Greenhorn

Joined: Dec 20, 2003
Posts: 13
I am now considering it is decided by the implement of app server.
If the server depend jvm to allocate memory,so the max heap is default 64M,
if the server depend native os to allocate memory,so the max heap can be 2G,which can be swaped to disk.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Do NOT preload all that stuff, rather load it on request only.
Let the database server worry about database performance and updating issues rather than caching everything yourself.
Also consider that your users will most likely never need all ten thousand items, most will want only one or two.
Why reserve memory for 10.000 items per user if they don't need that memory?
Then consider that you can save a lot of memory by not giving each customer a complete object with all info about the product.
Rather give him an object with just a reference to a single object that is shared among users and a number indicating the amount in his shopping cart (and maybe a number indicating the total price if there's customer-specific discounts).
Suddenly you're talking about maybe 1KB needed per customer instead of the 1MB you estimated.
Also consider that not all customers will be online simultaneously so you need not allocate memory for them all.
Don't start your day by creating an array of half a million customer records with 10.000 product records each.
Create customer records on the fly as they log in and assign them only those products they really are interested in.


42
Yajun Zhan
Greenhorn

Joined: Dec 20, 2003
Posts: 13
Thank you! Jeroen Wenting
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!
 
Similar Threads
Siteminder Session
Hibernate Session Problem
Response attribute?
how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!
ServletConfig and ServletContext