Pid wrote:
On 26/05/2011 21:50, André Warnier wrote:
André Warnier wrote:
Pid wrote:
On 26/05/2011 20:16, Caldarale, Charles R wrote:
From: André Warnier [mailto:a...@ice-sa.com] Subject: Monitoring
memory usage of JVM
I am thinking of a couple of command-line options for the JVM,
to dump for example some information each time a GC happens,
Try -verbose:gc and -Xloggc:<file_path_of_your_choice>
The jmap & jstat commands shipped with the JDK are also useful.
Thanks to both.
I'll try these out.
For now, I have used the "-verbose:gc and -Xloggc:" command-line
options, and added the jmap command into one of the other monitoring
shell scripts I created.
I'll have to wait for the next GC to see the output of the switches. As
the application isn't doing anything right now, that could take a while.
But a question about "jstat" in the meantime :
In the documentation of jstat, it has this to say about the /lvmid/ part :
port
The default port for communicating with the remote server. If the
hostname is omitted or the protocol specifies an optimized, local
protocol, then port is ignored. Otherwise, treatment of the port
parameter is implementation specific. For the default rmi protocol, the
port indicates the port number for the rmiregistry on the remote host.
If port is omitted, and protocol indicates rmi, then the default
rmiregistry port (1099) is used.
Is this the same port which I otherwise set for jconsole, iow via the
option :
-Dcom.sun.management.jmxremote.port=pppp
Yes, AFAIK. There's also a companion utility 'jstatd'.
I'll just continue adding here, so that everything stays together.
the output of the "-verbose:gc" switch looks as follows :
...
36980.453: [GC 479482K->271910K(994752K), 0.0135340 secs]
37085.411: [GC 511334K->269236K(992320K), 0.0130770 secs]
37750.377: [GC 508660K->276295K(999168K), 0.0124960 secs]
38078.813: [GC 524999K->286052K(997184K), 0.0077580 secs]
38187.341: [GC 534756K->295781K(1004032K), 0.0096650 secs]
38341.838: [GC 553765K->300854K(1001600K), 0.0230050 secs]
...
Searching the WWW, I am finding (too) many interpretations of the output of "-verbose:gc"
(or "-verbosegc", none of them starting from exactly the format above.
I can kind of guess what the above means, but where can I find an "authoritative"
interpretation for Sun/Oracle Java 1.6 ?
Also, does anyone know if there is a way to specify that instead of the unreadable leading
timestamp above, one can get a nicely-formatted one ?
(-XX:+PrintGCTimeStamps ?)
By the way, I know that there is an over-abudance of articles on the WWW about Java memory
tuning, but here is one I found serendipitiously :
http://fedora.fiz-karlsruhe.de/docs/Wiki.jsp?page=Java%20Heap%20%26%20GC%20Tuning
Even if it appears to have been written mainly for one kind of application, it is short,
readable, to-the-point, and I think usable in a broader context.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org