Summary: Troubleshooting tools for testing a running product and environmental issues.
CPU and Memory DumperCPU Dumper Java Utility for WindowsThe application starts a space and collects the memory and CPU utilization and dumps the threads when the CPU britches the configured CPU level.
A Script Utility for LinuxThe attached gsInstance.sh script script starts a space using the regular gsInstance.sh equivalent and dumps the threads once the application breeches a certain CPU level for a certain period, set by the TIME value. The CPU and TIME can be passed as additional arguments to the script. CPUUSAGE=$1 TIME=$2 if [ $# -lt 2 ] ; then echo "" echo "USAGE: ./gsInstance.sh <CPU> <TIME>" echo "" echo " <CPU> - CPU Utilization in percents (%)" echo " <TIME> - Time in seconds" echo "" echo "Example: ./gsInstance.sh 80 20 \"/./TestSpace\" " exit fi myPid=$$ chk=0 cpu=0 while [ 1 ] do str=`ps --ppid $myPid --no-headers -o pcpu,rss,pid,cmd| grep java ` cpu=`echo $str | awk '{print $1}'|cut -d. -f1` mem=`echo $str | awk '{print $2}'` echo "*********************************************" echo "*** CPU= $cpu % MEMORY= $mem K" echo "*********************************************" if [ $cpu -gt $CPUUSAGE ]; then chk=`expr $chk + 1` else chk=0 fi if [ $chk -ge $TIME ];then pid=`ps --ppid $myPid -o pid,pcpu,cmd | awk '{print $1}'` kill -3 $pid fi sleep 1 done Windows Debugging Tools
Packet Sniffer/Network Analyzer Tool
Threads DumperSendSignal UtilityJava has this great feature where if you hit Ctrl-break on the console, it dumps a list of threads and all their held locks to stdout. If your app is stuck or overwhelmed with too many threads, you can figure out what it is doing. If it is deadlocked/overwhelmed, sometimes the JVM can even tell you exactly which threads are involved. The problem is that if you can't get to the console, you can't hit ctrl-break. This commonly happens to us when we are running under an IDE. The IDE captures stdout and there is no console. If the app deadlocks, there is no way to get the crucial debugging info. Another common usage scenario is once we do not have access to the console itself. A very useful utility can be used for sending a Windows Ctrl+break signal to any process (or Java Process) and which will dump the threads.
Usage: Log Correlation ToolIn many scenarios, mainly in production or large deployments, you many times face issues occurred in the same time over several components and cross several distributed machines. In order to track down what was the root cause of the event and which were just symptoms you need to review many log files and correlate what happened in that specific time. In order to correlate events from different log files and visualize it you have to create a Log Correlation which is where the Eclipse Log and Trace Analyzer component (TPTP LTA) shines. This component is an extensive and extendable framework that includes built in probes mechanism. |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |