> From: André Warnier [mailto:a...@ice-sa.com]
> Subject: Re: CLOSE_WAIT and what to do about it
> 
> Relatedly, does there exist any way to force a given 
> JVM process to do a full GC interactively, but from a
> Linux command-line ?

Found a command line tool that will do what you want:
http://code.google.com/p/jmxsh/

I've used it to trigger a GC in Tomcat via the following steps.

1) Start Tomcat with the following options:
     -Dcom.sun.management.jmxremote.port=<port>
     -Dcom.sun.management.jmxremote.authenticate=false
     -Dcom.sun.management.jmxremote.ssl=false
   (You can, of course, set the authentication and SSL options as needed.)

2) Start jmxsh from the directory its jar is in with this:
      java -jar jmxsh*.jar

3) Enter the following commands (but not the bracketed bits):
      jmx_connect -h localhost -p <port>
      [blank line to enter browse mode]
      5  [selects java.lang]
      1  [selects the Memory mbean]
      5  [performs a GC]

The doc for jmxsh indicates the above steps should be scriptable, but I haven't 
tried that.

It is likely that you could use jmx_connect with a different kind of service 
and avoid opening up an RMI port; if I figure that out, I'll let you know.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to