• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Memory size for each http request

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody,

First post in JavaRanch !! Sorry for my poor english !

So I want to monitor the size in memory for each http request for my web application (under tomcat and wls).

Do you know a tool (not expansive ) or a way to do that.

The tools that I found (jprobe, jprofiler, ...) only allow to monitor global memory but don't allow to separate results by http requests.

Thanks for your answers.

sph
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Determining the size in memory for any single object is difficult. You should be able to get an idea by looking at the source code (I'm assuming you are using Tomcat and can get the source code). Basically there are a bunch of Strings for the various headers and parameters and some sort of Map to provide for lookup.

Of all the things that consume memory in servlet applications, the request should be the least of your worries since the attached objects are available for GC as soon as the response is returned.

Bill
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Test it with 0, 1, 10, 100 and 1000 requests.
Build the differences.
Make a graph.

Probably a single request needs more memory, than (2 requests)/2, because they share some memory (static variables i.e.).
 
Stephane Philippart
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answers, ly aim isn't to measure the reuest itself but the size
of the memory used between the moment where the appserver received the request and the moment where it send the response. This is for evaluate the memory need for several parallele users.

stef
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could write a load tester specific to your application that emulates a number of users. I have used the HttpClient toolkit free from this Apache Commons site.

Not only can you then look at the memory usage, but also at the response times under a varying load. In my case I wrote an XML file defining the user transactions to drive the load tester. I also stuck a simple response time histogram collector in the servlet.

The HttpUnit (see the Sourceforge project) could also be used.
Bill

[ EJFH: Fixed typo ]
[ July 30, 2004: Message edited by: Ernest Friedman-Hill ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic