Reputation: 867
I know we can use tools like JProfiler etc. Is there any tutorial on how to configure it to display the memory usage just by remote monitoring?
Any idea?
Upvotes: 3
Views: 17623
Reputation: 5798
You can change to VM params of your Java application to allow remote profiling
something like -agentlib:jprofilerti=port=25000
General explanation of JProfiler.
Examples:
Upvotes: 3
Reputation: 4862
I've heard good things of VisualVM and here is an article on how to it up remotely:
Java VisualVM to profile a remote server
EDIT: I wrote a blog post on how to setup remote profiling through an SSH tunnel here:
http://kamilmroczek.com/2012/11/16/168787859/
Upvotes: 0
Reputation: 879
Profile your application using Jprofiler. Below are the steps to configure your Tomcat with Jprofiler.
In Linux machine open .bash_profile
file from /root
directory.
Enter jprofiller location (using below command export) in
.bash_profile file
export LD_LIBRARY_PATH=/dsvol/jprofiler6/bin/linux-x86
Go Tomcat installation directory. Open catalena.sh
file from bin
folder.
Enter the below details in catelana.sh
file (only red color information and black color you can find by default in catalena.sh file).
export JPROFILER_HOME
JAVA_OPTS="-Xms768m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -agentpath:/opt/Performance/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849 $CATALINA_OPTS"
Start the server from bin folder by executing the starup.sh
command
Upvotes: 1
Reputation: 314
I usually use YourKit which is an excellent application (license needed).
In your webservers startup/shutdown script (catalina.sh for tomcat) put in:
JAVA_OPTS="-Djava.awt.headless=true -agentlib:yjpagent -Xrunyjpagent:sessionname=Tomcat"
You'll need YourKit already downloaded and added to your library path (I do this in catalina.sh as well):
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/yourkit/yjp-6.0.16/bin/linux-x86-32
You can then launch the YourKit client on your local desktop and remotely connect.
Upvotes: 7
Reputation: 4602
you have VisualGC, it's not very advanced but you can see the memory usage of your application (garbage,old, perm etc...)
http://java.sun.com/performance/jvmstat/visualgc.html
to resume : you launch a daemon monitoring on the remote machine (http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstatd.html, see the security parapraph)
JAVA_HOME/bin/jstatd -J-Djava.security.policy=jstatd.all.policy
with a file here called jstatd.all.policy containing :
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
on the remote machine you got the pid of your application to debug with the jps tool :
http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html#jps
finally on your local machine you launch the visualgc :
visualgc the_pid@remote_machine_address
Upvotes: 8