java profiling
Edithttp://jiprof.sourceforge.net/http://code.google.com/p/oktech-profiler/\[http://code.google.com/p/oktech-profiler/]
http://www.manageability.org/blog/stuff/open-source-profilers-for-java
http://www.ibm.com/developerworks/java/library/j-5things7.html
http://www.ibm.com/developerworks/kr/library/j-5things7.html
http://www.ibm.com/developerworks/kr/library/j-5things8.html
http://prezi.com/watosm3yizdd/presentation/
http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-sun/jvmstat/sun.jvmstat.monitor.htm
https://alibaba.github.io/arthas/en/
Btrace
- http://kenai.com/projects/btrace/pages/Home
- http://eggboy.egloos.com/1866372
- http://piotrnowicki.com/2012/05/btrace-a-simple-way-to-instrument-running-java-applications/ http://www.javacodegeeks.com/2012/06/introduction-to-btrace-for-java.html
- http://d2.naver.com/helloworld/9042309
- https://kenai.com/projects/btrace/sources/hg/content/samples/JdbcQueries.java
Visual VM
- Java Visual VM JDK에 포함된 무료 프로파일링 툴
- VisualVM
- VisualVM 플러그인 이야기
- JavaTool 유용한 자바툴 - jvisualvm]
- Troubleshooting application performance with VisualVM
Hprof (Heap And CPU Profiling Agent)
- http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
- http://wiki.ex-em.com/index.php/HProf
- http://wiki.ex-em.com/index.php/HProf
도움말 : java -agentlib:hprof
실행 : java -agentlib:hprof=heap=sites,cpu=samples,file=[filename] [Main Class]
덤프시그널 : kill -3 [PID]
java -agentlib:hprof=heap=dump,format=b,file=heapdump.hprof,doe=n HoldMemory
Jstat
jstat -gcutil
jstat -gcutil 1363 5s
jps는 /tmp/hsperfdata_계정명 으로 임시 파일들을 저장하는데. 이 파일들을 cent os에서 정의된 tmpwatch에서 지운다.
/etc/cron.daily/tmpwatch
JConsole
Heap Analyzer
- http://www-1.ibm.com/support/docview.wss?https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/https://heaphero.io/uid=swg27006624&aid=1
- http://jensor.sourceforge.net/
- http://bcho.tistory.com/entry/Sun-JVM-HeapDump-%EC%96%BB%EA%B8%B0
- https://heaphero.io/
- https://www.jxray.com/
- https://hat.dev.java.net/
- [Heap Dump 자바 힙 덤프(java heap dump) 분석기 - Eclipse Memory Analyzer]
- GC 상태 그래프 : http://www.alphaworks.ibm.com/tech/pmat
- MAT : http://www.eclipse.org/mat/
- MAT + IBM Heap analyzer : http://web-dev.tistory.com/623
Thread dump
http://yusuke.homeip.net/samurai/en/index.html
LWP확인
ps –Lf –p [pid]
- UID: 사용자ID
- PID: 프로세스ID
- PPID: 부모프로세스 ID
- LWP : Light Weight Process. 쓰레드 ID
- C : 지속적으로 사용한 CPU 사용량
- NLWP : 해당 프로세스에서 사용하는 쓰레드의 수. LWP 개수
- STIME: 프로세스가 시작한 시간
- TTY: 해당 프로세스를 통제하는 터미널
- TIME: 시:분:초 형식의 CPU 점유시간
- CMD:프로세스를 수행시킨 명령어
ps -mo pid,lwp,stime,time,pcpu -p javapid
16진수 → 10진수
- Bash> echo $0x1acc
- Bash> echo $16#1acc
- Python> print 0x1acc 10진수 → 16진수
- Python> print hex(6860)
- Bash> echo "obase=16;6860" | bc
Headump option
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=path
-XX:OnError="gcore%p"
Jmap
덤프파일생성
jmap -dump:format=b,file=dump.hprofpid
jmap -dump:live,format=b,file=<fileName> <pid>
jmap -dump:format=b,file=jvm.hprof jvm.core /jdk/bin/java
Heap histogram 뽑기. 반복해서 뽑아보고 증가가 큰 객체를 보는 방법도 유용하다
jmap -histo:live
Jhat
jhat <dumpFileName>
<font color="#0066cc">http://blogs.atlassian.com/2013/03/so-you-want-your-jvms-heap/</font>
gdb --pid=[pid]
(gdb) gcore jvm.core
(gdb) detach
(gdb) quit
jmap -histo:live <pid>
JRat
JIP
http://jiprof.sourceforge.net/ http://www.ibm.com/developerworks/java/library/j-jip/
oktech-profiler
http://code.google.com/p/oktech-profiler/
Monkey Wrench
Your kit
Java allocation instrumenter
http://code.google.com/p/java-allocation-instrumenter/
APM
http://www.javaperformancetuning.com/articles/apm1b.shtml
자원사용량으로 Applicatino 성능저하를 설명하기 어려움 애플리케이션 서비스가 필요로 하는 자원 중에 단 하나라도 부족하면 수행될 수 없음
Application은 물리적인 리소스를 직접 사용할 수 없음
OS나 시스템S/W는 H/W나 다른 하위 S/W 리소스를 Warping하여
시스템에 존재하는 모든 리소스를 리스트업할 수 없음(현실적으로 불가능)
어플리케이션을 프로파일링
자원의 부족은 자원사용량보다는 서비스 응답시간을 토해서 검출하는 것이 효과적
개별 트랜잭션의 응답시간을 분포도로 모니터링
외부리소스 호출부분..
외부리소스를 사용하는 클래스/메소드 연계지점
Jenifer
http://blog.naver.com/firebats?Redirect=Log&logNo=30039537369&vid=0
Spring insight
http://www.infoq.com/interviews/travis-springinsight
Byteman
Gglowroot
jvmtop
https://github.com/patric-r/jvmtop
heapster
운영환경에서 힙메모리 프로파일링 https://github.com/mariusae/heapster