summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.h
diff options
context:
space:
mode:
author wangguibo <wangguibo@xiaomi.com> 2021-04-24 11:27:06 +0800
committer Hans Boehm <hboehm@google.com> 2021-05-17 18:19:16 +0000
commit0d290721a8d63d5e0d38a64d3ecf922a91becb10 (patch)
tree02daf3bb3ae703da0a9b99a307f8bbfb2c03c748 /compiler/optimizing/graph_visualizer.h
parentc63d9672264e894d8d409e8d582b4e086b26abca (diff)
Dump java backtrace when contending lock too long time.
It’s easy to cause a problem when execute time-consuming work inside a synchronized method/block. Previously, we use "dvm_lock_sample" in event log to help us look into. But it's always after the event, "dvm_lock_sample" is printed after the owner thread exited the critical section, we don't know more details that which statement get stuck or more time-consuming. This implementation provides a lot more information about what the contending thread is doing. when a thread contend for a long time, we will print backtrack which thread holding the lock. Maybe many threads waiting this lock, those threads will request printing backtrack many times, which is helpful for finding and locating problems. This mechanism is only suitable for very long wait times, not lots of short wait times. This feature is heavyweight, it's not enabled by default. we can turn on by "-XX:MonitorTimeoutEnable" in AndroidRuntime::startVm. Bug:140968481 Test: Manually check contention log messages. Signed-off-by: wangguibo <wangguibo@xiaomi.com> Change-Id: I29784d11355ae3c581723254848a87cd80e71456
Diffstat (limited to 'compiler/optimizing/graph_visualizer.h')
0 files changed, 0 insertions, 0 deletions