SlideShare a Scribd company logo
1 of 100
Download to read offline
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | 3
Classroom Training
Learning Subscription
Live Virtual Class
Training On Demand
Keep Learning with Oracle University
education.oracle.com
Cloud
Technology
Applications
Industries
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Session Surveys
Help us help you!!
• Oracle would like to invite you to take a moment to give us your session
feedback. Your feedback will help us to improve your conference.
• Please be sure to add your feedback for your attended sessions by using
the Mobile Survey or in Schedule Builder.
4
HotSpot Synchronization
A Peek Under the Hood
David Buck
Principal Member of Technical Staff
Java SE
October 26, 2015
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
6
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Introduction
Java Locking Review
HotSpot’s Implementation
Profiling & Tuning
Everything Else
1
2
3
4
5
7
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Howdy!
David Buck
• Java SE Sustaining Engineering
• I Fix JVM Bugs
• Hobbies:
(non-Java) programming
8
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Introduction
9
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We’ll Cover
synchronized(this) {
c++;
}
10
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We’ll Cover
synchronized(this) {
c++;
}
11
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We’ll Cover
3: monitorenter
4: aload_0
5: dup
6: getfield #2 // Field c:I
9: iconst_1
10: iadd
11: putfield #2 // Field c:I
14: aload_1
15: monitorexit
12
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We’ll Cover
3: monitorenter
4: aload_0
5: dup
6: getfield #2 // Field c:I
9: iconst_1
10: iadd
11: putfield #2 // Field c:I
14: aload_1
15: monitorexit
13
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We Won’t Cover
14
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We Won’t Cover
• How to use locks
15
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We Won’t Cover
• How to use locks
• java.util.concurrent (JSR-166)
16
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
What We Won’t Cover
• How to use locks
• java.util.concurrent (JSR-166)
• Java’s memory model
17
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Motivation
18
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Motivation
• Avoiding premature optimization
19
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Motivation
• Avoiding premature optimization
• Improve Profiling, Design, and Tuning
20
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Motivation
• Avoiding premature optimization
• Improve Profiling, Design, and Tuning
• Fun!
21
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Locking Review
22
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Multithreading as Part of the Language
23
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
• So, what exactly is a Monitor?
24
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Mutual Exclusion
25
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Mutual Exclusion
Mut ex
26
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Mutual Exclusion
Mutex
27
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
condition variable
28
"Puffin crossing, London, UK" by
secretlondon is licensed under CC BY-SA 3.0
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Monitor = Mutex + Condition Variable
29
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Monitor = Mutex + Condition Variable
• Mutex
– synchronized keyword
30
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Monitor = Mutex + Condition Variable
• Mutex
– synchronized keyword
• Condition Variable
– Object.wait()
– Object.notify()
– Object.notifyAll()
31
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Locks are Recursive!
public synchronized void increment() {
c++;
printValue();
}
public synchronized void printValue() {
System.out.println("My value is: " + c);
}
32
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Memory Model
Establish a “happens-before” relationship
33
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
public class NoSync {
private int c = 0;
public void increment() {
c++;
}
}
34
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
public void increment();
flags: ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
0: aload_0
1: dup
2: getfield #2 // Field c:I
5: iconst_1
6: iadd
7: putfield #2 // Field c:I
10: return
35
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Block Example
public void increment() {
synchronized(this) {
c++;
}
}
36
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Block Example
public void increment();
flags: ACC_PUBLIC
Code:
stack=3, locals=3, args_size=1
0: aload_0
1: dup
2: astore_1
3: monitorenter
4: aload_0
5: dup
6: getfield #2 // Field c:I
9: iconst_1
10: iadd
11: putfield #2 // Field c:I
14: aload_1
15: monitorexit
16: goto 24
19: astore_2
20: aload_1
21: monitorexit
22: aload_2
23: athrow
24: return
Exception table:
from to target type
4 16 19 any
19 22 19 any
37
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Block Example
public void increment();
flags: ACC_PUBLIC
Code:
stack=3, locals=3, args_size=1
0: aload_0
1: dup
2: astore_1
3: monitorenter
4: aload_0
5: dup
6: getfield #2 // Field c:I
9: iconst_1
10: iadd
11: putfield #2 // Field c:I
14: aload_1
15: monitorexit
16: goto 24
19: astore_2
20: aload_1
21: monitorexit
22: aload_2
23: athrow
24: return
Exception table:
from to target type
4 16 19 any
19 22 19 any
38
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Method Example
public synchronized void increment() {
c++;
}
39
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Method Example
public synchronized void increment();
flags: ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=3, locals=1, args_size=1
0: aload_0
1: dup
2: getfield #2 // Field c:I
5: iconst_1
6: iadd
7: putfield #2 // Field c:I
10: return
40
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Method Example
public synchronized void increment();
flags: ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=3, locals=1, args_size=1
0: aload_0
1: dup
2: getfield #2 // Field c:I
5: iconst_1
6: iadd
7: putfield #2 // Field c:I
10: return
41
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Impossible in Java Language!
public void lockMe();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: monitorenter
2: return
public void unlockMe();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: monitorexit
2: return
42
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Bytecode
Expressive Power
Java Language
43
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
44
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
• No way to check status of a lock
45
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
• No way to check status of a lock
• No timeout
46
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
• No way to check status of a lock
• No timeout
• No way to cancel
47
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
• No way to check status of a lock
• No timeout
• No way to cancel
• Must be recursive
48
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
• No way to check status of a lock
• No timeout
• No way to cancel
• Must be recursive
• No reader / writer locking
49
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Monitor Limitations
• No way to check status of a lock
• No timeout
• No way to cancel
• Must be recursive
• No reader / writer locking
• Security Issues
50
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
java.util.concurrent
51
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
HotSpot’s Implementation
52
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Design Goals
53
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Design Goals
• Every object may be used as a monitor
54
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Design Goals
• Every object may be used as a monitor
• But most objects never are
55
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Design Goals
• Every object may be used as a monitor
• But most objects never are
• Those that are locked, are usually not used by multiple threads
56
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Design Goals
• Every object may be used as a monitor
• But most objects never are
• Those that are locked, are usually not used by multiple threads
• Those that are used by multiple threads, are usually not contended
57
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Lock Types
• Fat
• Thin
• Biased
58
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Biased Thin Fat
Footprint / Overhead
59
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Fat Lock
• Rely on OS scheduler
• Best use case: long wait times
• AKA: Heavyweight lock, inflated lock
60
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Thin Lock
• Spin until lock is available
• Best use case: short pause times
• AKA: spin lock, stack lock (HS), lightweight lock
61
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Biased Lock
• Only a single thread repeatedly locks object
• If other thread needs lock, bias needs to be revoked
62
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
BiasedLock Revocation
• Stop thread that currently holds bias (STW)
• Check if thread “really” holds lock (stack walk)
63
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
BiasedLock Banning
• Object Level
• Class Level
• Booting Phase
64
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Per-Object Data
• Field data
• Metadata
– Monitor condition
– GC bookkeeping (e.g. age)
– Hash code
65
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Object Header
Field Data
Class Pointer
Mark Word
66
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Busy Mark Word is Busy
Mark Word
Hashcode GC Data Monitor
67
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Hashcode GC Data Monitor
00Data
68
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Thin Locked
Hashcode GC Data Monitor
00Displaced Mark Word Pointer
69
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Inflating
Hashcode GC Data Monitor
00NULL
70
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Unlocked
Banned for Biased Locking
Hashcode GC Data Monitor
01Unused 0
Age /
CMS
Hashcode
71
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Biased
Hashcode GC Data Monitor
01未使用 1
Age /
CMS
Thread ID / Epoc
72
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Fat Locked
Hashcode GC Data Monitor
01MonitorObject Pointer
73
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
GC Running(STW)
Hashcode GC Data Monitor
11Reserved by GC
74
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Lock Record
Copied Mark Word
Object Pointer
75
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Lock Record
Copied Mark Word
Object Pointer
01
Age /
CMS
Hash
code
Object Pointer
Thread Stack
76
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Thin Lock
01
Age /
CMS
Hash
code
Object Pointer
Field Data
Class Pointer
Pointer 00
Thread Stack Object
77
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Thin Lock (Recursive)
01
Age /
CMS
Hash
code
Object Pointer
Field Data
Class Pointer
Pointer 00
Thread Stack Object
Unused
Object Pointer
78
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Fat Lock
Field Data
Class Pointer
Pointer 00
11Unused
Object Pointer
Thread Stack Object
ObjectMonitor
01
Age /
CMS
Hash
code
Object Pointer
79
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Lock Transitions
80
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Biased Thin Fat
Footprint / Overhead
81
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Profiling & Tuning
82
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Profiling
DANGER:
Performance Impact Ahead!
83
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Profiling
• Performance Counters
• DTrace
• Java Flight Recorder
84
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Performance Counters
• No performance impact
• Not officially supported
• Intended for HotSpot troubleshooting
• Example:
jstat -snap -J-Djstat.showUnsupported=true <JVM_PID> |grep _sync
85
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
DTrace
• Most flexible
• Higher learning curve
• Supported platforms
– Solaris
– Oracle Linux
– OSX
• Must use -XX:+DTraceMonitorProbes
86
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
DTrace
Mutex Probes
• monitor-contended-enter
• monitor-contended-entered
• monitor-contended-exit
87
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
DTrace
Condition Variable Probes
• monitor-wait
• monitor-waited
• monitor-notify
• monitor-notifyAll
88
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Flight Recorder
• Free for development use
• Supported Platforms: all OracleJDK Java SE Platforms
89
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Options
• PrintConcurrentLocks
• UseBiasedLocking
• DTraceMonitorProbes
• BiasedLockingStartupDelay
• PrintBiasedLockingStatistics
• TraceBiasedLocking
• TraceMonitorInflation
• MonitorInUseLists
• TraceMonitorMismatch
• UseHeavyMonitors
• BiasedLockingBulkRebiasThreshold
• BiasedLockingBulkRevokeThreshold
• BiasedLockingDecayTime
• SyncKnobs
90
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Options
• PrintConcurrentLocks
• UseBiasedLocking
• DTraceMonitorProbes
• BiasedLockingStartupDelay
• PrintBiasedLockingStatistics
• TraceBiasedLocking
• TraceMonitorInflation
• MonitorInUseLists
• TraceMonitorMismatch
• UseHeavyMonitors
• BiasedLockingBulkRebiasThreshold
• BiasedLockingBulkRevokeThreshold
• BiasedLockingDecayTime
• SyncKnobs
91
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
PrintConcurrentLocks
• Displays java.util.concurrent locks in thread dumps just like normal locks!
92
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
UseBiasedLocking
• Disables biased locking
• Worth trying (benchmarking) on systems with very high contention
93
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Everything Else
94
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Concurrent Programming in Java™:
Design Principles and Patterns
• JDK 1.2 Era
– No modern memory model
– The source of java.util.concurrent
• Focus on design
• A classic
95
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Java Concurrency in Practice
• JDK 1.6 Era
– New Memory Model
– java.util.concurrent
• If you read only one book on Java
concurrency…
96
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Summary
• Leave optimization up to the JVM
• If simple monitors do not provide what you need, check out
java.util.concurrent
• Profiling tools: JFR or DTrace
– Watch out for performance impact
• Everyone really should read CPiJ and JCiP
97
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Thank You!!!
98
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
References
• [ jstat man page ]
https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html
• [ DTrace Probes in HotSpot VM ]
http://docs.oracle.com/javase/8/docs/technotes/guides/vm/dtrace.html
• [ JMC Tutorial ]
http://hirt.se/blog/?p=611
• [ David Dice's Weblog ]
https://blogs.oracle.com/dave/
• [ HotSpot Internals ]
https://wiki.openjdk.java.net/display/HotSpot/Main
99
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]

More Related Content

What's hot

Unified JVM Logging
Unified JVM LoggingUnified JVM Logging
Unified JVM LoggingYuji Kubota
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
 
API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細
API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細
API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細オラクルエンジニア通信
 
Auditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPASAuditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPASEDB
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
 
Cloud foundry: The Platform for Forging Cloud Native Applications
Cloud foundry: The Platform for Forging Cloud Native ApplicationsCloud foundry: The Platform for Forging Cloud Native Applications
Cloud foundry: The Platform for Forging Cloud Native ApplicationsChip Childers
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
 
Monitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeatMonitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeatJulien Pivotto
 
Container Security
Container SecurityContainer Security
Container SecurityJie Liau
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...PROIDEA
 
Googleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOpsGoogleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOpsEtsuji Nakai
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfJosé Paumard
 
How to Use OWASP Security Logging
How to Use OWASP Security LoggingHow to Use OWASP Security Logging
How to Use OWASP Security LoggingMilton Smith
 
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組みさくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組みTakeshi Ogawa
 
ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索Will Huang
 
Spring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugSpring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugMasatoshi Tada
 
Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Grant McAlister
 
Git/Gerrit with TeamForge
Git/Gerrit with TeamForgeGit/Gerrit with TeamForge
Git/Gerrit with TeamForgeCollabNet
 

What's hot (20)

Unified JVM Logging
Unified JVM LoggingUnified JVM Logging
Unified JVM Logging
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細
API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細
API Gateway - ヘッダー/クエリー変換、認証・認可機能詳細
 
Auditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPASAuditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPAS
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 
Kubernetes Security
Kubernetes SecurityKubernetes Security
Kubernetes Security
 
Cloud foundry: The Platform for Forging Cloud Native Applications
Cloud foundry: The Platform for Forging Cloud Native ApplicationsCloud foundry: The Platform for Forging Cloud Native Applications
Cloud foundry: The Platform for Forging Cloud Native Applications
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 
Monitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeatMonitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeat
 
Container Security
Container SecurityContainer Security
Container Security
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
 
Googleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOpsGoogleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOps
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdf
 
How to Use OWASP Security Logging
How to Use OWASP Security LoggingHow to Use OWASP Security Logging
How to Use OWASP Security Logging
 
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組みさくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組み
 
ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索
 
Spring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugSpring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjug
 
Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput
 
Git/Gerrit with TeamForge
Git/Gerrit with TeamForgeGit/Gerrit with TeamForge
Git/Gerrit with TeamForge
 

Similar to HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]

Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법Mee Nam Lee
 
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]David Buck
 
JShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java PlatformJShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java PlatformJavaDayUA
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesPavel Bucek
 
Take Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerTake Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerSteven Feuerstein
 
OOW15 - Maintenance Strategies for Oracle E-Business Suite
OOW15 - Maintenance Strategies for Oracle E-Business SuiteOOW15 - Maintenance Strategies for Oracle E-Business Suite
OOW15 - Maintenance Strategies for Oracle E-Business Suitevasuballa
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em StartupsMySQL Brasil
 
CompletableFuture уже здесь
CompletableFuture уже здесьCompletableFuture уже здесь
CompletableFuture уже здесьDmitry Chuyko
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureJavaDayUA
 
Using Edition-Based Redefinition for Zero Downtime PL/SQL Changes
Using Edition-Based Redefinition for Zero Downtime PL/SQL ChangesUsing Edition-Based Redefinition for Zero Downtime PL/SQL Changes
Using Edition-Based Redefinition for Zero Downtime PL/SQL ChangesChris Saxon
 
2015 CJUG MVC 1.0
2015 CJUG MVC 1.02015 CJUG MVC 1.0
2015 CJUG MVC 1.0mnriem
 
How to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesHow to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesGuatemala User Group
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesFrederic Descamps
 
Modern App Development with Oracle Cloud
Modern App Development with Oracle CloudModern App Development with Oracle Cloud
Modern App Development with Oracle CloudJuan Carlos Ruiz Rico
 
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?jeckels
 

Similar to HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570] (20)

Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
 
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
 
JShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java PlatformJShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java Platform
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based Microservices
 
Take Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerTake Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL Compiler
 
Partitioning 101
Partitioning 101Partitioning 101
Partitioning 101
 
OOW15 - Maintenance Strategies for Oracle E-Business Suite
OOW15 - Maintenance Strategies for Oracle E-Business SuiteOOW15 - Maintenance Strategies for Oracle E-Business Suite
OOW15 - Maintenance Strategies for Oracle E-Business Suite
 
Cool SQL Features
Cool SQL FeaturesCool SQL Features
Cool SQL Features
 
MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups
 
CompletableFuture уже здесь
CompletableFuture уже здесьCompletableFuture уже здесь
CompletableFuture уже здесь
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and Architecture
 
Using Edition-Based Redefinition for Zero Downtime PL/SQL Changes
Using Edition-Based Redefinition for Zero Downtime PL/SQL ChangesUsing Edition-Based Redefinition for Zero Downtime PL/SQL Changes
Using Edition-Based Redefinition for Zero Downtime PL/SQL Changes
 
Brickman-Brunette 2015-ICMC
Brickman-Brunette 2015-ICMCBrickman-Brunette 2015-ICMC
Brickman-Brunette 2015-ICMC
 
2015 CJUG MVC 1.0
2015 CJUG MVC 1.02015 CJUG MVC 1.0
2015 CJUG MVC 1.0
 
JavaMicroBenchmarkpptm
JavaMicroBenchmarkpptmJavaMicroBenchmarkpptm
JavaMicroBenchmarkpptm
 
How to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of DatabasesHow to Upgrade Hundreds or Thousands of Databases
How to Upgrade Hundreds or Thousands of Databases
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best Practices
 
Modern App Development with Oracle Cloud
Modern App Development with Oracle CloudModern App Development with Oracle Cloud
Modern App Development with Oracle Cloud
 
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?
 

More from David Buck

JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]David Buck
 
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...David Buck
 
Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]David Buck
 
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...David Buck
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]David Buck
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...David Buck
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]David Buck
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage CollectorDavid Buck
 
Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019David Buck
 
Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018David Buck
 
JDK 10 へようこそ
JDK 10 へようこそJDK 10 へようこそ
JDK 10 へようこそDavid Buck
 
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]David Buck
 
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]David Buck
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]David Buck
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]David Buck
 
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]David Buck
 
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]David Buck
 

More from David Buck (20)

JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
 
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
 
Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]
 
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
 
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage Collector
 
Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019
 
Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018
 
JDK 10 へようこそ
JDK 10 へようこそJDK 10 へようこそ
JDK 10 へようこそ
 
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
 
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
 
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
 
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
 
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
 

Recently uploaded

WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 

Recently uploaded (20)

WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 

HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]

  • 1.
  • 2.
  • 3. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | 3 Classroom Training Learning Subscription Live Virtual Class Training On Demand Keep Learning with Oracle University education.oracle.com Cloud Technology Applications Industries
  • 4. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Session Surveys Help us help you!! • Oracle would like to invite you to take a moment to give us your session feedback. Your feedback will help us to improve your conference. • Please be sure to add your feedback for your attended sessions by using the Mobile Survey or in Schedule Builder. 4
  • 5. HotSpot Synchronization A Peek Under the Hood David Buck Principal Member of Technical Staff Java SE October 26, 2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
  • 6. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 6
  • 7. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Java Locking Review HotSpot’s Implementation Profiling & Tuning Everything Else 1 2 3 4 5 7
  • 8. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Howdy! David Buck • Java SE Sustaining Engineering • I Fix JVM Bugs • Hobbies: (non-Java) programming 8
  • 9. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Introduction 9
  • 10. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We’ll Cover synchronized(this) { c++; } 10
  • 11. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We’ll Cover synchronized(this) { c++; } 11
  • 12. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We’ll Cover 3: monitorenter 4: aload_0 5: dup 6: getfield #2 // Field c:I 9: iconst_1 10: iadd 11: putfield #2 // Field c:I 14: aload_1 15: monitorexit 12
  • 13. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We’ll Cover 3: monitorenter 4: aload_0 5: dup 6: getfield #2 // Field c:I 9: iconst_1 10: iadd 11: putfield #2 // Field c:I 14: aload_1 15: monitorexit 13
  • 14. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We Won’t Cover 14
  • 15. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We Won’t Cover • How to use locks 15
  • 16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We Won’t Cover • How to use locks • java.util.concurrent (JSR-166) 16
  • 17. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What We Won’t Cover • How to use locks • java.util.concurrent (JSR-166) • Java’s memory model 17
  • 18. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Motivation 18
  • 19. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Motivation • Avoiding premature optimization 19
  • 20. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Motivation • Avoiding premature optimization • Improve Profiling, Design, and Tuning 20
  • 21. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Motivation • Avoiding premature optimization • Improve Profiling, Design, and Tuning • Fun! 21
  • 22. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Locking Review 22
  • 23. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Multithreading as Part of the Language 23
  • 24. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | • So, what exactly is a Monitor? 24
  • 25. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Mutual Exclusion 25
  • 26. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Mutual Exclusion Mut ex 26
  • 27. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Mutual Exclusion Mutex 27
  • 28. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | condition variable 28 "Puffin crossing, London, UK" by secretlondon is licensed under CC BY-SA 3.0
  • 29. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Monitor = Mutex + Condition Variable 29
  • 30. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Monitor = Mutex + Condition Variable • Mutex – synchronized keyword 30
  • 31. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Monitor = Mutex + Condition Variable • Mutex – synchronized keyword • Condition Variable – Object.wait() – Object.notify() – Object.notifyAll() 31
  • 32. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Locks are Recursive! public synchronized void increment() { c++; printValue(); } public synchronized void printValue() { System.out.println("My value is: " + c); } 32
  • 33. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Memory Model Establish a “happens-before” relationship 33
  • 34. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | public class NoSync { private int c = 0; public void increment() { c++; } } 34
  • 35. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | public void increment(); flags: ACC_PUBLIC Code: stack=3, locals=1, args_size=1 0: aload_0 1: dup 2: getfield #2 // Field c:I 5: iconst_1 6: iadd 7: putfield #2 // Field c:I 10: return 35
  • 36. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Block Example public void increment() { synchronized(this) { c++; } } 36
  • 37. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Block Example public void increment(); flags: ACC_PUBLIC Code: stack=3, locals=3, args_size=1 0: aload_0 1: dup 2: astore_1 3: monitorenter 4: aload_0 5: dup 6: getfield #2 // Field c:I 9: iconst_1 10: iadd 11: putfield #2 // Field c:I 14: aload_1 15: monitorexit 16: goto 24 19: astore_2 20: aload_1 21: monitorexit 22: aload_2 23: athrow 24: return Exception table: from to target type 4 16 19 any 19 22 19 any 37
  • 38. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Block Example public void increment(); flags: ACC_PUBLIC Code: stack=3, locals=3, args_size=1 0: aload_0 1: dup 2: astore_1 3: monitorenter 4: aload_0 5: dup 6: getfield #2 // Field c:I 9: iconst_1 10: iadd 11: putfield #2 // Field c:I 14: aload_1 15: monitorexit 16: goto 24 19: astore_2 20: aload_1 21: monitorexit 22: aload_2 23: athrow 24: return Exception table: from to target type 4 16 19 any 19 22 19 any 38
  • 39. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Method Example public synchronized void increment() { c++; } 39
  • 40. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Method Example public synchronized void increment(); flags: ACC_PUBLIC, ACC_SYNCHRONIZED Code: stack=3, locals=1, args_size=1 0: aload_0 1: dup 2: getfield #2 // Field c:I 5: iconst_1 6: iadd 7: putfield #2 // Field c:I 10: return 40
  • 41. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Method Example public synchronized void increment(); flags: ACC_PUBLIC, ACC_SYNCHRONIZED Code: stack=3, locals=1, args_size=1 0: aload_0 1: dup 2: getfield #2 // Field c:I 5: iconst_1 6: iadd 7: putfield #2 // Field c:I 10: return 41
  • 42. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Impossible in Java Language! public void lockMe(); flags: ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: monitorenter 2: return public void unlockMe(); flags: ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: monitorexit 2: return 42
  • 43. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Bytecode Expressive Power Java Language 43
  • 44. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations 44
  • 45. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations • No way to check status of a lock 45
  • 46. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations • No way to check status of a lock • No timeout 46
  • 47. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations • No way to check status of a lock • No timeout • No way to cancel 47
  • 48. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations • No way to check status of a lock • No timeout • No way to cancel • Must be recursive 48
  • 49. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations • No way to check status of a lock • No timeout • No way to cancel • Must be recursive • No reader / writer locking 49
  • 50. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Monitor Limitations • No way to check status of a lock • No timeout • No way to cancel • Must be recursive • No reader / writer locking • Security Issues 50
  • 51. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | java.util.concurrent 51
  • 52. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | HotSpot’s Implementation 52
  • 53. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Design Goals 53
  • 54. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Design Goals • Every object may be used as a monitor 54
  • 55. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Design Goals • Every object may be used as a monitor • But most objects never are 55
  • 56. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Design Goals • Every object may be used as a monitor • But most objects never are • Those that are locked, are usually not used by multiple threads 56
  • 57. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Design Goals • Every object may be used as a monitor • But most objects never are • Those that are locked, are usually not used by multiple threads • Those that are used by multiple threads, are usually not contended 57
  • 58. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Lock Types • Fat • Thin • Biased 58
  • 59. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Biased Thin Fat Footprint / Overhead 59
  • 60. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Fat Lock • Rely on OS scheduler • Best use case: long wait times • AKA: Heavyweight lock, inflated lock 60
  • 61. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Thin Lock • Spin until lock is available • Best use case: short pause times • AKA: spin lock, stack lock (HS), lightweight lock 61
  • 62. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Biased Lock • Only a single thread repeatedly locks object • If other thread needs lock, bias needs to be revoked 62
  • 63. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | BiasedLock Revocation • Stop thread that currently holds bias (STW) • Check if thread “really” holds lock (stack walk) 63
  • 64. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | BiasedLock Banning • Object Level • Class Level • Booting Phase 64
  • 65. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Per-Object Data • Field data • Metadata – Monitor condition – GC bookkeeping (e.g. age) – Hash code 65
  • 66. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Object Header Field Data Class Pointer Mark Word 66
  • 67. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Busy Mark Word is Busy Mark Word Hashcode GC Data Monitor 67
  • 68. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Hashcode GC Data Monitor 00Data 68
  • 69. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Thin Locked Hashcode GC Data Monitor 00Displaced Mark Word Pointer 69
  • 70. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Inflating Hashcode GC Data Monitor 00NULL 70
  • 71. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Unlocked Banned for Biased Locking Hashcode GC Data Monitor 01Unused 0 Age / CMS Hashcode 71
  • 72. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Biased Hashcode GC Data Monitor 01未使用 1 Age / CMS Thread ID / Epoc 72
  • 73. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Fat Locked Hashcode GC Data Monitor 01MonitorObject Pointer 73
  • 74. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | GC Running(STW) Hashcode GC Data Monitor 11Reserved by GC 74
  • 75. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Lock Record Copied Mark Word Object Pointer 75
  • 76. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Lock Record Copied Mark Word Object Pointer 01 Age / CMS Hash code Object Pointer Thread Stack 76
  • 77. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Thin Lock 01 Age / CMS Hash code Object Pointer Field Data Class Pointer Pointer 00 Thread Stack Object 77
  • 78. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Thin Lock (Recursive) 01 Age / CMS Hash code Object Pointer Field Data Class Pointer Pointer 00 Thread Stack Object Unused Object Pointer 78
  • 79. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Fat Lock Field Data Class Pointer Pointer 00 11Unused Object Pointer Thread Stack Object ObjectMonitor 01 Age / CMS Hash code Object Pointer 79
  • 80. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Lock Transitions 80
  • 81. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Biased Thin Fat Footprint / Overhead 81
  • 82. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Profiling & Tuning 82
  • 83. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Profiling DANGER: Performance Impact Ahead! 83
  • 84. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Profiling • Performance Counters • DTrace • Java Flight Recorder 84
  • 85. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Performance Counters • No performance impact • Not officially supported • Intended for HotSpot troubleshooting • Example: jstat -snap -J-Djstat.showUnsupported=true <JVM_PID> |grep _sync 85
  • 86. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | DTrace • Most flexible • Higher learning curve • Supported platforms – Solaris – Oracle Linux – OSX • Must use -XX:+DTraceMonitorProbes 86
  • 87. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | DTrace Mutex Probes • monitor-contended-enter • monitor-contended-entered • monitor-contended-exit 87
  • 88. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | DTrace Condition Variable Probes • monitor-wait • monitor-waited • monitor-notify • monitor-notifyAll 88
  • 89. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Flight Recorder • Free for development use • Supported Platforms: all OracleJDK Java SE Platforms 89
  • 90. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Options • PrintConcurrentLocks • UseBiasedLocking • DTraceMonitorProbes • BiasedLockingStartupDelay • PrintBiasedLockingStatistics • TraceBiasedLocking • TraceMonitorInflation • MonitorInUseLists • TraceMonitorMismatch • UseHeavyMonitors • BiasedLockingBulkRebiasThreshold • BiasedLockingBulkRevokeThreshold • BiasedLockingDecayTime • SyncKnobs 90
  • 91. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Options • PrintConcurrentLocks • UseBiasedLocking • DTraceMonitorProbes • BiasedLockingStartupDelay • PrintBiasedLockingStatistics • TraceBiasedLocking • TraceMonitorInflation • MonitorInUseLists • TraceMonitorMismatch • UseHeavyMonitors • BiasedLockingBulkRebiasThreshold • BiasedLockingBulkRevokeThreshold • BiasedLockingDecayTime • SyncKnobs 91
  • 92. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | PrintConcurrentLocks • Displays java.util.concurrent locks in thread dumps just like normal locks! 92
  • 93. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | UseBiasedLocking • Disables biased locking • Worth trying (benchmarking) on systems with very high contention 93
  • 94. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Everything Else 94
  • 95. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Concurrent Programming in Java™: Design Principles and Patterns • JDK 1.2 Era – No modern memory model – The source of java.util.concurrent • Focus on design • A classic 95
  • 96. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Java Concurrency in Practice • JDK 1.6 Era – New Memory Model – java.util.concurrent • If you read only one book on Java concurrency… 96
  • 97. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Summary • Leave optimization up to the JVM • If simple monitors do not provide what you need, check out java.util.concurrent • Profiling tools: JFR or DTrace – Watch out for performance impact • Everyone really should read CPiJ and JCiP 97
  • 98. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Thank You!!! 98
  • 99. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | References • [ jstat man page ] https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html • [ DTrace Probes in HotSpot VM ] http://docs.oracle.com/javase/8/docs/technotes/guides/vm/dtrace.html • [ JMC Tutorial ] http://hirt.se/blog/?p=611 • [ David Dice's Weblog ] https://blogs.oracle.com/dave/ • [ HotSpot Internals ] https://wiki.openjdk.java.net/display/HotSpot/Main 99