Skip to main content

Determining memory consumption of web application

3 replies [Last post]
brausepaul
Offline
Joined: 2008-11-25
Points: 0

Hi,

I'm at the beginning of a new Java web application project and I have to figure out if the application will fit to our existing application servers (Websphere 6.1) or if we have to think of new/more hardware. My main problem is memory consumption. I have a rather good idea of user numbers (500 users) but I have a hard time to determine the amount of memory each user will need.

Some facts: The web application will be Struts 1.3 based, it will have about five screens only (the GUI layer is smallish) and no native database. It will use a custom third-party framework for mainframe access. Communication with the mainframe's database will rely on XML (which is a constraint we have to live with for now). To put it simple: each SELECT or INSERT etc. will need a XML document. No screen will have more than 12 records, each record having about 20 datafields (which basically will be input fields for the user). My reasoning so far:

20 datafields * 20 characters * 2 bytes = 800 bytes per record
800 bytes * 12 records = 9600 bytes
9600 + 20 % "per-user-session" overhead = 11520 bytes -> 12 kilobytes
12 kilobytes * 500 users = 6000 kilobytes (note: this seems very low to me for 500 users)

But these 6000 kilobytes are "payload-only", the application will need more memory because of the frameworks (Struts, third-party framework etc...), it will have to create XML documents, it must create objects out of XML documents etc...and that's exactly the part where I have no clue about. Is it okay just to add the frameworks' jar files sizes to my number? Any idea about how much overhead XML will cause? Any hint or advice is greatly appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
brausepaul
Offline
Joined: 2008-11-25
Points: 0

Problem is that we have to put up numbers before we can deploy anything. The application server's maintenance crew needs/wants to know how much RAM they have to allocate to our VM.

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

You can't predict the exact behaviour, if you haven't tested it with the expected load.
Either run load tests yourself, or try to interpolate. However I would definitivly recommend tests ;)

- Clemens

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

The only way I know is to measure memory requirement with e.g. 5, 10, 50 users and interpolate.
You can measure memory useage e.g. with JConsole or VisualVM, pressing the GC button a few times and looking at the heap occupation.

Good luck, Clemens