SlideShare a Scribd company logo
1 of 88
Download to read offline
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted
Cloud Native Java: GraalVM
이상과 현실
김태완(taewanme@gmail.com)
Oracle	Korea	Solution	Engineering
@taewanme,	http://taewan.kim
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
자바 다양성 시대
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 2
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 3
http://www.graalvm.org/
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Why	GraalVM?
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 4
8.	Java	code	as	a	native	library
1.	High-performance	modern	Java
2.	Low-footprint,	fast-startup	Java
3.	Combine	JavaScript,	Java,	Ruby,	and	R
4.	Run	native	languages	on	the	JVM
5.	Tools	that	work	across	all	languages
6.	Extend	a	JVM-based	application
7.	Extend	a	native	application
9.	Polyglot	in	the	database
10.	Create	your	own	languagehttps://chrisseaton.com/truffleruby/tenthings/
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Why	GraalVM?
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 5
8.	Java	code	as	a	native	library
1.	High-performance	modern	Java
2.	Low-footprint,	fast-startup	Java
3.	Combine	JavaScript,	Java,	Ruby,	and	R
4.	Run	native	languages	on	the	JVM
5.	Tools	that	work	across	all	languages
6.	Extend	a	JVM-based	application
7.	Extend	a	native	application
9.	Polyglot	in	the	database
10.	Create	your	own	language
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Why	GraalVM?
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 6
8.	Java	code	as	a	native	library
1.	High-performance	modern	Java
2.	Low-footprint,	fast-startup	Java
3.	Combine	JavaScript,	Java,	Ruby,	and	R
4.	Run	native	languages	on	the	JVM
5.	Tools	that	work	across	all	languages
6.	Extend	a	JVM-based	application
7.	Extend	a	native	application
9.	Polyglot	in	the	database
10.	Create	your	own	language
IoT
Polyglot
Cloud	Native
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Why	GraalVM?
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 7
8.	Java	code	as	a	native	library
1.	High-performance	modern	Java
2.	Low-footprint,	fast-startup	Java
3.	Combine	JavaScript,	Java,	Ruby,	and	R
4.	Run	native	languages	on	the	JVM
5.	Tools	that	work	across	all	languages
6.	Extend	a	JVM-based	application
7.	Extend	a	native	application
9.	Polyglot	in	the	database
10.	Create	your	own	language
IoT
Polyglot
Cloud	Native
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Why	GraalVMè Native	Application
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 8
8.	Java	code	as	a	native	library
1.	High-performance	modern	Java
2.	Low-footprint,	fast-startup	Java
3.	Combine	JavaScript,	Java,	Ruby,	and	R
4.	Run	native	languages	on	the	JVM
5.	Tools	that	work	across	all	languages
6.	Extend	a	JVM-based	application
7.	Extend	a	native	application
9.	Polyglot	in	the	database
10.	Create	your	own	language
IoT
Polyglot
Cloud	Native
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 9
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 10
https://medium.com/graalvm/instant-netty-startup-using-
graalvm-native-image-generation-ed6f14ff7692
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM Team
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 11
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM 개발 팀:	Research
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 12
64편 이상 논문(2012	~	2019)
https://www.graalvm.org/community/publications/
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 13
8	+												+
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
dk
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 14
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 15
JIT	Compiler
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Write	Once,	Run	Anywhere
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 16
이미지 출처: https://commons.wikimedia.org/wiki/File:Java-program-execution.png
- javac compiler
- Java	code(String)	è byte[]
- java	Binary	Representation
- compact	&	small
- JIT	compiler
- byte[]	è byte[]	(machine	code)
- compact	&	small	representation
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Compiler
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 17
• AOT(Ahead-of-Time)	Compiler
• JIT (Just-In-Time)	Compiler
Static vs	Dynamic
Compiler
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
AOT 컴파일러와 Dynamic	컴파일러 공통점
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 18
AOT	
Compiler
JIT
Compiler
è Machine	Code è Machine	Code
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
AOT 컴파일러와 Dynamic	컴파일러 차이점
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 19
AOT	Compiler JIT Compiler
Source code → Native executable Source code → Bytecode →
Interpreter + JIT executable
실행전에 무겁고 복잡한 분석&최적화 수행
실행 환경 정보 수집 어려움
Static Code 최적화
공격적이고 낙관적인 최적화
실행 프로파일 정보를 활용
특정 환경 특화된 최적화
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
JIT	Compiler의 목표
빠른 컴파일 속도 & 최적화
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 20
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
JIT	Compiler
• Speculation	Without	Regret:	Reducing	Deoptimization	Meta-data	in	the	
Graal	compiler
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 21
http://ssw.jku.at/General/Staff/GD/PPPJ-2014-duboscq-29.pdf
JVM
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
HotSpot Optimization
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 22
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Optimization:	inlining
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 23
int addAll(int max){
int accum = 0;
for(int i = 0; i<max; i++) {
accum = add (accum, i);
}
return accum;
}
int add(int a, int b){return a+b;}
int addAll(int max){
int accum = 0;
for(int i = 0; i<max; i++) {
accum = accum + i;
}
return accum;
}
Optimization:	inlining
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
JVM	성능 향상
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 24
http://www.dominicgiles.com/blog/files/abdb7a96e9db63644317c62d6e40c40b-142.html
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
JVM	성능 향상 주체
• JIT	Compiler
– Profiling &
• CPU,	Memory,	Object	Tracking,	Mem
– Optimization
• 더 효율적인 코디 패턴 감지
• 더 효율적인 머신 코드 생성
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 25
http://ssw.jku.at/General/Staff/GD/PPPJ-2014-duboscq-29.pdf
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Intel	CPU의 Java	최적화
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 26
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 27
HotSpot
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
HotSpot
• Oracle	Java	JVM
• Java	SE	1.3(1999.	04)에 추가
• 개발 언어: C++
• 2개의 JIT	compiler를 포함
– C1:	client compiler
• C1	디자인:	빠른 시작
• 코드 최적화의 비중 낮춤
– C2:	server compiler
• C2	디자인:	약간 느린 시작
• 코드 최적화 비중 높임
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 28
HotSpot VM
C1 C2
Compiler	Interface
HotSpot VM
c++
c++
c++
c++
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
JVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 29
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
HotSpot 의 고민
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 30
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
HotSpot – Limitation
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 31
https://github.com/netroby/jdk9-
dev/blob/master/jdk/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 32
GraalVM &	Graal
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 33
8	+												+
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 34
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 35
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM Team
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 36
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM의 핵심 키워드
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 37
Graal /	JVMCI Polyglot/	Truffle Native	Image
NEW	JIT	Complier Language	Platform AOT	Compiler
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Graal !=	GraalVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 38
HotSpot VM
C1 C2
Compiler	Interface
OpenJDK 8
HotSpot VM
Compiler	Interface JVMCI
C1 Graal
GraalVM
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Graal
• GraalVM의 새로운 JIT	Compiler
• Hotspot의 C2	JIT	컴파일러 대체가 목표
• Java로 개발
• C2와 비교하여 20% 선능 개선 (Twitter	사례)
– Production	Scala	애플리케이션에 적용
– GraalVM CE(Community	Edition)
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 39
https://www.youtube.com/watch?v=ZbccuoaLChk
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Community	Edition
• Free
• Unsupported
• Runs	all	GraalVM languages
– Java	(+Scala),	JavaScript,	Python,	Ruby,	R
• Support	for	native	libraries	in	context	of	those	languages	too
– Tools	(debugger,	profiler,	monitor	agent)
• Basic	version	of	SubstrateVM
– Native	code	has	full	access	to	address	space
• Runs	code	in	JVM,	Node.js,	MySQL,	or	standalone
Enterprise	Edition
• Not	Free
• Supported
• Best	performance	&	size
– Graal	EE	Java	is	20%	faster	than	CE	(on	average)
– Dynamic	languages	(JS,	Python,	R,	Ruby)	2x	faster
– Smallest	footprint	– 2x	smaller	vs CE
• Native	code	memory	protection
• Debugging	tools	for	embedded	use
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 40
GraalVM 라이센스
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Scala	2.12.6	&	GraalVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 41
https://medium.com/graalvm/compiling-scala-faster-with-graalvm-86c5c0857fa3
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
graal compiler
• OpenJDK 9	+
• OpenJDK 10	+
• OpenJDK 11	+
• GraalVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 42
-XX:+UnlockExperimentalVMOptions 
-XX:+UseJVMCICompiler 
-XX:+EnableJVMCI
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
graal compiler
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 43
https://www.graalvm.org/docs/examples/java-performance-examples/
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e01
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
graal compiler	Demo
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 44
OpenJDK 11,	Tiered	Compiler OpenJDK 11,	Graal Compiler
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e01
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
graal compiler	결과
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 45
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
graal compiler	Demo:	compile	log
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 46
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e01
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Graal과 Twitter
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 47
https://www.youtube.com/watch?v=G-vlQaPMAxg
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM 기능과 JEP
• JEP:	JDK	Enhancement	Proposal
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 48
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 49
Native	Image
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Native	Runtime
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 50
Java
Java or node.js or R or Ruby or Python
or C/C++ User Function
SVM
dynamically
executed
native
precompiled
Graal VM on SubstrateVM
Java
Java or node.js or R or Ruby or Python
or C/C++ User Function
HotSpot
dynamically
executed
native
precompiled
Graal VM on HotSpot
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Native	Image	
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 51
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
작은 footprint,	신속한 startup
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 52
OpenJDK 11,	Graal Compiler
SubstrateVM	(SVM)
• GraalVM의 하위 프로젝트
• JVM	애플리케이션을 컴파일하여 Native	실행파일을 생성
• Ahead-of-time	compiler- 빠른 시작을 유도
• Virtual	머신이 필요 없음
• 작은 메모리로 시작
• 38Mbyte	virt.x	애플리케이션을 10MB	RAM에서 돌린 사례
• https://www.jetdrone.xyz/2018/08/10/Vertx-native-image-
10mb.html
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Native	Image	Demo
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 53
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Graal &	SubstrateVM
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 54
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
빠른 Startup:	Heap	Image
• d
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 55
https://medium.com/graalvm/isolates-and-compressed-references-more-flexible-and-
efficient-memory-management-for-graalvm-a044cc50b67e
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Substrate	VM	Java	Limitations
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 56
https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md
항목 지원
Dynamic	Class	Loading	/	Unloading Not	supported
Reflection Mostly	supported
Dynamic	Proxy Mostly	supported
Java	Native	Interface	(JNI) Mostly	supported
Unsafe	Memory	Access Mostly	supported
Static	Initializers Partially	supported
InvokeDynamic	Bytecode	and	Method	Handles Not	supported
Finalizers Not	supported
References Mostly	supported
Security	Manager Not	supported
JVMTI,	JMX,	other	native	VM	interfaces Not	supported
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Micronaut의 GraalVM 지원
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 57
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Micronaut의 GraalVM 지원
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 58
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Micronaut의 GraalVM 지원
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 59
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM 기능과 JEP
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 60
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 61
Polyglot
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Truffle
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 62
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Polyglot	Virtualization
63
Truffle	API
JavaVM Runtime
JavaScript
Interpreter
Ruby
Interpreter
R
Interprete
r
Graal
compiler
Compiled	
code	snippetCompiled	
code	snippetCompiled	
code	snippetCompiled	
code	snippetCompiled	
code	snippetCompiled	
code	snippet
JavaScript	
application
JavaScript	
libraries
Node.js
…
Ruby	
application
Ruby	gems	
&	libraries
Rails
LLVM	.bc
Interpreter
R	native	
libraries
Node.js	
native	libs
Ruby/Rails	
native	libs
Threads	/	Scheduler Filesystem Network GC	/	heap Code	cache
Java	
application
Truffle	
Polyglot	
API
eval("application/x-ruby",
"def add(a, b) a + b;
end;");
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM Ecosystem
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 64
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Ployglot Performance
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 65
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM Language	Status
Available	2017
Available	2018
Proposed	/	Prototyping
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 66
Java
C
C++
Python
C#
VB.NET
JavaScript
Assembly	language
PHP
PerlRubyVBSwift
R
Objective-C
Go
MATLAB
Delphi/Object	Pascal
PL/SQL
Scratch
Others
PROGRAMMING	LANGUAGE	POPULARITY
(TOP	20	LANGUAGES	FROM	MAY	2017	TIOBE INDEX)
Groovy
FORTRAN
Kotlin
Clojure
Scala
F#
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Java에서 다른 언어 호출
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 67
import org.graalvm.polyglot.*;
public class Sample {
public static void main(String[] args) {
try (Context context = Context.newBuilder().allowAllAccess(true).build()){
System.out.println( context.getEngine().getLanguages().keySet());
context.eval("ruby", "puts '안녕, 루비’”);
context.eval("python", "print(안녕, 파이썬')");
context.eval("js", "console.log(‘안녕, JS')");
context.eval("R", "cat(‘안녕, R')");
} catch (PolyglotException e) {
e.printStackTrace();
}
}
}
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e04
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
spring-r:	mvn spring-boot:run
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 68
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e06
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Spring-r	UI:	http://localhost:8080/load
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 69
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e06
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Java에서 다른 언어를 호출 (LLVM)
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 70
#include	<stdio.h>
int main(){
print(“Hello	from	graalvm!n”);
return 0;	
}
$	clang	-c	-O1	-emit-llvm hello.c
$	lli hello.bc
Hello	from	graalvm!
$
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e03
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Java에서 다른 언어를 호출 (LLVM)
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 71
import	org.graalvm.polyglot.*;	
import	java.io.*;	
public	class	Sample	{	
public	static	void	main(String[]	args)	throws	Exception	{
File	f	=	new	File("hello.bc");	
Source	source	=	Source.newBuilder("llvm",	new	File("hello.bc")).build();	
try	(Context				context	=	Context.newBuilder().allowAllAccess(true).build()){	
context.eval(source).execute();	
}	
}	
}	
https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e03
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 72
https://github.com/taewanme/graalvm_seminar_examples
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 73
GraalVM 현재
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 74
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 75
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 76
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 77
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 78
GraalVM 사례
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 79
Twitter
https://www.youtube.com/watch?v=PtgKmzgIh4c
• Twitter	VM	팀은 Graal
컴파일러를 사용하여 Scala	
기반 microservices 운영
• 메모리 할당과 성능 향상
• 성능 개선: 20%
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 80
Goldman	Sachs
https://www.youtube.com/watch?time_continue=417&v=MUECwHdr07Q
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 81
GraalVM Summary
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM의 목표: Six	degrees	of	freedom
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 82
https://commons.wikimedia.org/wiki/File:6DOF.svg
• Fast	Startup	Java	Application:	Native
• High	Performance	Java	Application
• Integrated	Polyglot	Application
• Java	as	Language	Platform
• Embedded	Java	Application
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
GraalVM, OpenJDK, Oracle	Java
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 83
Graal
Native	Image
JVMCI
JEP	243:	Java-Level	JVM	Compiler	Interface
JEP	295:	Ahead-of-Time	Compilation
JEP	317:	Experimental	Java-Based	JIT	Compiler
9	~	12
8
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
추가 자료
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 84
• http://taewan.kim/post/graalvm_seminar/ 발표 동영상
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
추가 자료
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 85
• https://github.com/taewanme/graalvm_seminar_examples
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
추가자료
Confidential	– Oracle	Internal/Restricted/Highly	Restricted 86
gitter.im/graalvm
Copyright	©	2019,	Oracle	and/or	its	affiliates.	All	rights	reserved.		| Confidential	– Oracle	Internal/Restricted/Highly	Restricted 87
Cloud Native Java GraalVM 이상과 현실

More Related Content

What's hot

HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOUHOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
Lucas Jellema
 

What's hot (20)

Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in Production
 
What's new in Java 11
What's new in Java 11What's new in Java 11
What's new in Java 11
 
Java 10 New Features
Java 10 New FeaturesJava 10 New Features
Java 10 New Features
 
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOUHOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Building Better Data Pipelines using Apache Airflow
Building Better Data Pipelines using Apache AirflowBuilding Better Data Pipelines using Apache Airflow
Building Better Data Pipelines using Apache Airflow
 
Introduction to Java 11
Introduction to Java 11 Introduction to Java 11
Introduction to Java 11
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
NiFi 시작하기
NiFi 시작하기NiFi 시작하기
NiFi 시작하기
 
GraalVm and Quarkus
GraalVm and QuarkusGraalVm and Quarkus
GraalVm and Quarkus
 
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
 
Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
 
Swagger
SwaggerSwagger
Swagger
 
Chicago alm user group tfs version control poster - tfvc and git
Chicago alm user group   tfs version control poster - tfvc and gitChicago alm user group   tfs version control poster - tfvc and git
Chicago alm user group tfs version control poster - tfvc and git
 
Why Scala?
Why Scala?Why Scala?
Why Scala?
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 

Similar to Cloud Native Java GraalVM 이상과 현실

Similar to Cloud Native Java GraalVM 이상과 현실 (20)

Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
 
20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM
 
General Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajevGeneral Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajev
 
GraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajevGraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajev
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
 
Confoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSetConfoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSet
 
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
 
Docker Compose Setup for MySQL InnoDB Cluster
Docker Compose Setup for MySQL InnoDB ClusterDocker Compose Setup for MySQL InnoDB Cluster
Docker Compose Setup for MySQL InnoDB Cluster
 
Cloud Native Java:GraalVM
Cloud Native Java:GraalVMCloud Native Java:GraalVM
Cloud Native Java:GraalVM
 
Cloud Native 자바 플랫폼: Graalvm Overview
Cloud Native 자바 플랫폼: Graalvm OverviewCloud Native 자바 플랫폼: Graalvm Overview
Cloud Native 자바 플랫폼: Graalvm Overview
 
Node.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development TechniquesNode.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development Techniques
 
Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1
 
API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential 
 
9thMeetup-20190316-CI/CD 기반의 Microservice 배포
9thMeetup-20190316-CI/CD 기반의 Microservice 배포9thMeetup-20190316-CI/CD 기반의 Microservice 배포
9thMeetup-20190316-CI/CD 기반의 Microservice 배포
 
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
 
GraalVM Overview Compact version
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
 

More from Taewan Kim

More from Taewan Kim (9)

Oracle APEX 기초 워크샵 - 실습 가이드 문서: Part 2 (2/2)
Oracle APEX 기초 워크샵 - 실습 가이드 문서:  Part 2 (2/2)Oracle APEX 기초 워크샵 - 실습 가이드 문서:  Part 2 (2/2)
Oracle APEX 기초 워크샵 - 실습 가이드 문서: Part 2 (2/2)
 
Oracle APEX 기초 워크샵 - 실습 가이드 문서: Part 1 (1/2)
Oracle APEX 기초 워크샵 - 실습 가이드 문서:  Part 1 (1/2)Oracle APEX 기초 워크샵 - 실습 가이드 문서:  Part 1 (1/2)
Oracle APEX 기초 워크샵 - 실습 가이드 문서: Part 1 (1/2)
 
[OCI 새소식] OCI Burstable Instance
[OCI 새소식] OCI Burstable Instance[OCI 새소식] OCI Burstable Instance
[OCI 새소식] OCI Burstable Instance
 
오라클 클라우드 OCI 기초 개념 & 용어 정리
오라클 클라우드 OCI 기초 개념 & 용어 정리오라클 클라우드 OCI 기초 개념 & 용어 정리
오라클 클라우드 OCI 기초 개념 & 용어 정리
 
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
 
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL (2019.05.18) oracle-nosql pu...
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL  (2019.05.18) oracle-nosql pu...11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL  (2019.05.18) oracle-nosql pu...
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL (2019.05.18) oracle-nosql pu...
 
2018 Oracle Impact 발표자료: Oracle Enterprise AI
2018  Oracle Impact 발표자료: Oracle Enterprise AI2018  Oracle Impact 발표자료: Oracle Enterprise AI
2018 Oracle Impact 발표자료: Oracle Enterprise AI
 
Oracle Code in Seoul: Provisioning of Cloud Resource
Oracle Code in Seoul: Provisioning of Cloud ResourceOracle Code in Seoul: Provisioning of Cloud Resource
Oracle Code in Seoul: Provisioning of Cloud Resource
 
Oracle Container Cloud Service & Docker Overview
Oracle Container Cloud Service & Docker OverviewOracle Container Cloud Service & Docker Overview
Oracle Container Cloud Service & Docker Overview
 

Recently uploaded

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Recently uploaded (20)

DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 

Cloud Native Java GraalVM 이상과 현실