0% found this document useful (0 votes)
12 views

Process Debugging - Information Collection

1. This document provides information on collecting various system and process level diagnostics for debugging purposes. It outlines steps to gather operating system details, find specific processes, collect process information, analyze Java processes, use profiling and debugging utilities, and references additional resources. 2. Key process debugging steps include finding top processes by CPU/memory usage, process IDs by port, processes of a user, Java stack traces, heap summaries, and GC information. System debugging covers OS version, patches, uptime, current/swap memory, and activity monitoring. 3. Additional process details involve state, threads, open files, network connections, activity monitoring, memory maps, stack traces, and core files. Profiling utilities mentioned are Eclipse

Uploaded by

nehaagrawal2210
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Process Debugging - Information Collection

1. This document provides information on collecting various system and process level diagnostics for debugging purposes. It outlines steps to gather operating system details, find specific processes, collect process information, analyze Java processes, use profiling and debugging utilities, and references additional resources. 2. Key process debugging steps include finding top processes by CPU/memory usage, process IDs by port, processes of a user, Java stack traces, heap summaries, and GC information. System debugging covers OS version, patches, uptime, current/swap memory, and activity monitoring. 3. Additional process details involve state, threads, open files, network connections, activity monitoring, memory maps, stack traces, and core files. Profiling utilities mentioned are Eclipse

Uploaded by

nehaagrawal2210
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Process Debugging - Information Collection

System level information Finding processes


1. Version of the operating system 1. Find top 10 processes by %CPU usage
more /etc/redhat-release ps -eo %cpu,pid,cmd | sort -nr | head -
10
2. Patch Level
2. Find top 10 processes by %resident memory usage
rpm -qa
ps -eo %mem,pid,cmd | sort -nr | head -
3. Up time 10
uptime 3. Find process identifier by port number
4. Current processes lsof -i:<port> | grep "\(LISTEN\)" |
top -bcn 1 awk '{print $2}'
5. Swap memory 4. Find processes of a specific user
free -mt top -bcn 1 -u <user_login>
6. Virtual memory statistics 5. Find all java processes
vmstat 5 5 top -bcn 1 -p `pgrep java | tr "\n" ","
| sed 's/,$//'`
7. System activity
sar

Process Information Java Process Information


1. Process state 1. Stack trace
top -bcn 1 -p <pid> jstack <pid>
2. Process state including threads 2. Heap summary
top -Hbcn 1 -p <pid> jmap -heap <pid>
3. Open files 3. GC Information
lsof -p <pid> jstat -gc <pid> 250 20
4. Network connections
netstat -an | grep <port_number>
Utilities
1. Convert core dump to heap dump
lsof -i:<port_number>
jmap -
5. Process activity (10 seconds) dump:format=b,file=jvm.<pid>.hprof
strace -t -e trace=network,file,process /usr/local/java/jdk/bin/java
-fp <pid> & sleep 10 ; kill $! ./core.<pid>
6. Memory map 2. Reading specific memory location from a process
pmap -x <pid> cat /proc/<pid>/maps
7. Stack trace gdb --pid <pid>
pstack <pid> (gdb) dump memory mem.<pid>.bin
0x00621000 0x00622000
8. Core file (!make sure that there is enough space, core
hexdump -C mem.<pid>.bin | less
files can be large)
gcore -o core <pid>

Profilers References
 http://docs.oracle.com/cd/E19857-01/820-
 Eclipse MAT 4983/gebbt/index.html
 JProfiler  http://docs.oracle.com/cd/E19159-01/820-
2974/gboyx/index.html
 http://stackoverflow.com/questions/1765311/viewing-file-in-
binary-in-terminal

[email protected]

You might also like