Hi there,

I usually track the memory consumption of each request using a debug info 
which prints the free memory available.

Runtime r = Runtime.getRuntime();
long freeMem = r.freeMemory();
System.out.println("free memory: " + freeMem);

I think packaging this into a memory tracking module for all requests 
served could be quite informative for a developer. 
Personally I think it's a fundamental weakness of Java that you don't have 
a String.getMemoryConsumption() method or something like that. That would 
make it much easier to track memory consumption.

However, the garbage collector seems to run at quite undetermined 
intervals, because after ten requests in a row the free memory goes up 
again. Does anybody know how to configure the garbage collector for 
Tomcat?

Cheers,
Johannes





"Shapira, Yoav" <[EMAIL PROTECTED]> 
03.04.2003 21:39
Please respond to
"Tomcat Users List" <[EMAIL PROTECTED]>


To
"Tomcat Users List" <[EMAIL PROTECTED]>
cc

Subject
RE: monitoring web apps







Howdy,
The JVM itself (so tomcat as well) can't track memory usage or CPU usage
"per webapp" as webapp is not a unit of execution in the JVM.

Using a profiler and some load/stress tests, you can profile one
application at a time to discern its resource consumption and behavior
under stress.  But getting this information at runtime, without a
profiler, is difficult at best and basically intractable in common
setups.

Part of the problem is it all comes down to the basic java data types,
e.g. String and int.  You can see that there are 10000 Strings in the
heap, and with a profiler you can tell where those Strings were created,
but you can't tell how much total memory they take.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Steve Harris [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 03, 2003 2:35 PM
>To: [EMAIL PROTECTED]
>Subject: monitoring web apps
>
>Hi all,
>
>I run a few apps under tomcat 4 and I'm wondering if there are any
tools
>for monitoring what each app is doing - memory usage, cpu utilization
etc
>?  I use the manager for monitoring numbers of users, stopping/starting
>etc but I'm looking for something that geives me more insight.
>
>Cheers - Steve
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to