java profiling

Edit

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/tools/sun/tools/jstack/JStack.java.htm

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

Visual VM

Hprof (Heap And CPU Profiling Agent)

도움말 : 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

Thread dump

http://yusuke.homeip.net/samurai/en/index.html

LWP확인

ps –Lf –p [pid]

ps -mo pid,lwp,stime,time,pcpu -p javapid

16진수 → 10진수

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

http://jrat.sourceforge.net/

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

http://www.yourkit.com/

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

Jennifer 4.0 사용기

http://blog.naver.com/firebats?Redirect=Log&logNo=30039537369&vid=0

Spring insight

http://www.infoq.com/interviews/travis-springinsight

Byteman

http://www.jboss.org/byteman/

Gglowroot

https://glowroot.org/

jvmtop

https://github.com/patric-r/jvmtop

heapster

운영환경에서 힙메모리 프로파일링 https://github.com/mariusae/heapster