16. トラップ!その1
tmpwatch
/tmpや/var/tmpを定期的にお掃除するツール
○ Red Hat系ディストロではおなじみ
/tmp/hsperfdata_<ユーザー名>も消しやがる!
○ psではプロセスが見えるのにJDK付属ツールでアタッ
チできない場合に疑うべきポイント
○ RHBZ#527425 - /tmp/hsperfdata_${user}/${PID} is
deleted by tmpwatch
やっぱり同じことで困ってる人がいました
Fedoraならtmpwatch-2.9.16-1.fc13からOKだそうです
17. トラップ!その2
java.io.tmpdir
6u23、6u24のみ該当
○ 6938627: Make temporary directory use property
java.io.tmpdir when specified
○ 7009828: Fix for 6938627 breaks visualvm
monitoring when -Djava.io.tmpdir is defined
6938627が入ったことで、各種ツールが動かなく
なってしまう人が続出
○ 実はDynamic Attachも影響を受けます
HotSpot混迷の時代
22. カスタム版jstat_options
option custom{
column {
header "^Threads^"
data java.threads.live
scale raw
align right
width 4
format "0"
}
column {
header "^MonitorContention^"
data sun.rt._sync_Parks
scale raw
align right
width 4
format "0"
}
column {
header "^STW^"
data (sun.rt.safepointTime/sun.os.hrt.frequency)
scale raw
align right
width 6
format "0.000"
}
column {
header "^ThreadA^"
data perfCounter.test.ThreadA.invocations
scale raw
align right
width 3
format "0"
}
column {
header "^ThreadB^"
data perfCounter.test.ThreadB.invocations
scale raw
align right
width 3
format "0"
}
column {
header "^ThreadC^"
data perfCounter.test.ThreadC.invocations
scale raw
align right
width 3
format "0"
}
}
28. トラップ!その1
Linux x86_64環境で動かないことがあります
7003789: PTRACE_GETREGS problems with SA
on Linux.
○ JDK6u25、JDK7以降ならFix済み
$ /usr/local/jdk1.6.0_14/bin/jstack -F 8675
Attaching to process ID 8675, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 14.0-b16
Deadlock Detection:
No deadlocks found.
Thread 8693: (state = BLOCKED)
Error occurred during stack walking:
sun.jvm.hotspot.debugger.DebuggerException:
sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
29. トラップ!その2
Linux環境でコアイメージを読み込めないこと
があります
7133122: SA throws
sun.jvm.hotspot.debugger.UnmappedAddressExce
ption when it should not
○ 全JDKに影響
○ 2012/01にパッチを出したものの、なかなか入れても
らえない…
$ /usr/local/jdk1.6.0/bin/jstack /usr/local/jdk1.6.0/bin/java core.1249
Attaching to core core.1249 from executable /usr/local/jdk1.6.0/bin/java, please wait...
Error attaching to core file: Can't attach to the core file