SlideShare una empresa de Scribd logo
1 de 115
Descargar para leer sin conexión
이경민 
LG전자 
RE-viewofAndroid L DeveloperPRE-view
http://developer.android.com/preview/index.html
1 
http://developer.android.com/preview/index.html
1 
2 
http://developer.android.com/preview/index.html
Material Design 
Goals 
-Create a visual language that synthesizes classic principles of good design with the innovation and possibility of technology and science. 
-Develop a single underlying system that allows for a unified experience across platforms and device sizes. Mobile precepts are fundamental, but touch, voice, mouse, and keyboard are all first-class input methods. 
Material is the metaphor 
Bold, graphic, intentional 
Motionprovides meaning 
Principles 
http://www.google.com/design/spec/material-design/introduction.html
Android Runtime 
https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/
Android Runtime 
https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/ 
Dalvikis dead, long live Dalvik! DO NOT MERGE
Android Runtime 
https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/ 
Dalvikis dead, long live Dalvik! DO NOT MERGE
Android Runtime 
https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/ 
Dalvikis dead, long live Dalvik! DO NOT MERGE
Key Architectural Changes in L
Key Architectural Changes in L 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread
Key Architectural Changes in L 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation
Key Architectural Changes in L 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation
Agenda 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation
Render Thread in L 
http://www.youtube.com/watch?v=3TtVsy98ces 
① 
① 
②
Render Thread in L 
http://www.youtube.com/watch?v=3TtVsy98ces 
②
Render Thread in L 
http://www.youtube.com/watch?v=3TtVsy98ces
Render Thread in L 
http://www.youtube.com/watch?v=3TtVsy98ces 
One of the most exciting topics that was glossed over was the introduction of a dedicatedrender thread. The goal of the render threadis to take many of the atomic animationsintroduced with material designand perform them autonomously, so they don’t hold up the primary UI toolkit thread. 
Source: http://www.willowtreeapps.com/blog/google-io-from-the- trenches-android-l-and-material-design/
UI (Main) Thread 
Activity 
ThreadHelloAndroid.apk 
Activity 
Looper 
Message 
Queue 
Service 
BroadcastReceiver 
ContentProvider 
H 
handleMessage() 
ViewRootImpl 
handleMessage() 
TLS 
Threaded 
Task 
Binder 
Object 
Storage 
(File,Prefs,DB,Network) 
Window 
Android 
Manifest.xml 
Resources 
Intent 
Views 
Views 
Views 
Application 
Instrumentation test.apk 
Test Case
Looper, Message Queue, and Handler
GPUI -UI on the GPU (Honeycomb~) 
Source: Google I/O 2011 –Accelerated Android Rendering
GPUI -UI on the GPU (Honeycomb~) 
Source: Google I/O 2011 –Accelerated Android Rendering 
CPU Rasterization 
GPU Composition
GPUI -UI on the GPU (Honeycomb~) 
Increased Number of Pixels 
Source: Google I/O 2011 –Accelerated Android Rendering 
CPU Rasterization 
GPU Composition
GPUI -UI on the GPU (Honeycomb~) 
Increased Number of Pixels 
Source: Google I/O 2011 –Accelerated Android Rendering 
CPU Rasterization 
GPU Composition 
GPU RasterizationGPU Composition
GPUI -UI on the GPU (Honeycomb~) 
GPUI 
Display List 
View Layers 
Display List Properties 
Increased Number of Pixels 
Source: Google I/O 2011 –Accelerated Android Rendering 
… 
CPU Rasterization 
GPU Composition 
GPU RasterizationGPU Composition
Display List 
A display list records a series of graphics related operation and can replay them later. 
Display lists are usually built by recording operations on a android.graphics.Canvas. 
Replaying the operations from a display list avoids executing views drawing code on every 
frame, and is thus much more efficient. 
DisplayList::Op[Non-Drawing] 
<<enumeration>> 
+Sav e 
+Restore 
+RestoreToCount 
+Sav eLayer 
+Sav eLayerAlpha 
+Translate 
+Rotate 
+Scale 
+Skew 
+SetMatrix 
+ConcatMatrix 
+ClipRect 
DisplayList::Op[Drawing] 
<<enumeration>> 
+DrawDisplayList 
+DrawLayer 
+DrawBitmap 
+DrawBitmapMatrix 
+DrawBitmapRect 
+DrawBitmapData 
+DrawBitmapMesh 
+DrawPatch 
+DrawColor 
+DrawRect 
+DrawRoundRect 
+DrawCircle 
+DrawOv al 
+DrawArc 
+DrawPath 
+DrawLines 
+DrawPoints 
+DrawText 
+DrawTextOnPath 
+DrawPosText 
+ResetShader 
+SetupShader 
+ResetColorFilter 
+SetupColorFilter 
+ResetShadow 
+SetupShadow 
+ResetPaintFilter 
+SetupPaintFilter 
+DrawGLFunction 
OpenGLRenderer 
drawDisplayList(…) 
DisplayList 
replay(…) 
DisplayListRenderer 
draw*(…, SkPaint) 
void* buffer 
SkWriter32 
write*(…) 
SkReader32 
read*() 
GLES20RecordingCanvas 
draw*(…, Paint) 
android_view_ 
GLES20Canvas_draw*(…) 
GLES20Canvas 
drawDisplayList(…) 
draw*(…, SkPaint) 
GLES2/gl2.h 
glXXX(…) 
Source: 10th Kandroid Conference – Skia and FreeType: Android 2D Graphics Essentials
Display List 
A display list records a series of graphics related operation and can replay them later. 
Display lists are usually built by recording operations on a android.graphics.Canvas. 
Replaying the operations from a display list avoids executing views drawing code on every 
frame, and is thus much more efficient. 
DisplayList::Op[Non-Drawing] 
<<enumeration>> 
+Sav e 
+Restore 
+RestoreToCount 
+Sav eLayer 
+Sav eLayerAlpha 
+Translate 
+Rotate 
+Scale 
+Skew 
+SetMatrix 
+ConcatMatrix 
+ClipRect 
DisplayList::Op[Drawing] 
<<enumeration>> 
+DrawDisplayList 
+DrawLayer 
+DrawBitmap 
+DrawBitmapMatrix 
+DrawBitmapRect 
+DrawBitmapData 
+DrawBitmapMesh 
+DrawPatch 
+DrawColor 
+DrawRect 
+DrawRoundRect 
+DrawCircle 
+DrawOv al 
+DrawArc 
+DrawPath 
+DrawLines 
+DrawPoints 
+DrawText 
+DrawTextOnPath 
+DrawPosText 
+ResetShader 
+SetupShader 
+ResetColorFilter 
+SetupColorFilter 
+ResetShadow 
+SetupShadow 
+ResetPaintFilter 
+SetupPaintFilter 
+DrawGLFunction 
OpenGLRenderer 
drawDisplayList(…) 
DisplayList 
replay(…) 
DisplayListRenderer 
draw*(…, SkPaint) 
void* buffer 
SkWriter32 
write*(…) 
SkReader32 
read*() 
GLES20RecordingCanvas 
draw*(…, Paint) 
android_view_ 
GLES20Canvas_draw*(…) 
GLES20Canvas 
drawDisplayList(…) 
draw*(…, SkPaint) 
GLES2/gl2.h 
glXXX(…) 
Source: 10th Kandroid Conference – Skia and FreeType: Android 2D Graphics Essentials
Display List: An Example 
DrawDisplayList 
DrawPatch 
Save 
Translate 
ConcatMatrix 
DrawBitmap 
RestoreToCount 
$ adbshell dumpsysgfxinfo[pid|pname] 
JB (API Level 18) 
Source: 12thKandroid Conference –Terminology and History of Android Performance Features
Android Animation 
DrawableAnimation 
Frame(-by-Frame) Animation 
View Animation 
Tween(ed)Animation 
Property Animation 
What 
Showing a sequence of images in order 
Performing a series of transformations on a single image 
Modifying an object's property values over a set period of time 
Added/ 
Updated 
1 
1, 4 
11, 16,18, 19 
APIs 
android.graphics.drawable. 
AnimationDrawable 
android.view.animation.* 
android.animation.* 
(2011/02) Animation in Honeycombhttp://android-developers.blogspot.kr/2011/02/animation-in-honeycomb.html 
(2011/05) Introducing ViewPropertyAnimatorhttp://android-developers.blogspot.kr/2011/05/introducing-viewpropertyanimator.html 
(2011/11) Android 4.0 Graphics and Animationshttp://android-developers.blogspot.kr/2011/11/android-40-graphics-and-animations.html 
Source: 13thKandroid MinMax–Silky Rendering Choreographer and Animation
Property Animation (Pre-Jellybean) 
Source: 13thKandroid MinMax–Silky Rendering Choreographer and Animation 
ValueAnimator 
doAnimationFrame() 
TimeInterpolatorgetInterpolation() 
Elapsed Fraction 
TypeEvaluator 
evaluate() 
Interpolated Fraction 
Current Value 
Frame Time 
( Frame Time –Start Time ) / Duration 
Math.pow( Elapsed Fraction, 2 Factor ) 
e.g., AccelerateInterpolator 
AnimatorUpdateListener 
onAimationUpdate() 
Start Value+ ( End Value–Start Value )  Interpolated Fraction 
Thread Local Storage 
sendEmptyMessageDelayed() w/ ANIMATION_FRAME 
handleMessage() 
sendEmptyMessage() w/ ANIMATION_START 
AnimationHandler 
start() 
1 
2 
3 
4 
5 
6 
7 
8
Drawing w/ Single UI Thread 
Activity 
SurfaceFlinger 
Event 
Set Property 
Value 
Invalidate 
Measure & 
Layout 
Prepare 
Draw 
Update 
DisplayList 
Draw 
DisplayList 
Swap 
Buffers 
Display 
List 
Dequeue 
Buffer 
Composite 
Windows 
Post 
Buffer 
Enqueue 
Buffer 
Something 
Happens 
Draw 
Display
Drawing w/ UI & Render Threads 
Activity 
SurfaceFlinger 
Event 
Set Property 
Value 
Invalidate 
Measure & 
Layout 
Prepare 
Draw 
Update 
DisplayList 
Draw 
DisplayList 
Swap 
Buffers 
Display 
List 
Dequeue 
Buffer 
Composite 
Windows 
Post 
Buffer 
Enqueue 
Buffer 
Something 
Happens 
Draw 
Display 
Render Thread
Threads in Action 
Threads in KitKat
Threads in Action 
Threads in KitKat
Threads in Action 
Threads in KitKat 
Threads in L
Threads in Action 
Threads in KitKat 
Threads in L
Food for Further Review
Food for Further Review 
Comparison w/ Other Technology/Platforms
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx 
•Web Animations: Javascript-based vs. CSS-basedhttp://www.html5rocks.com/en/tutorials/speed/high-performance-animations/
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx 
•Web Animations: Javascript-based vs. CSS-basedhttp://www.html5rocks.com/en/tutorials/speed/high-performance-animations/ 
Implications to Application Developers
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx 
•Web Animations: Javascript-based vs. CSS-basedhttp://www.html5rocks.com/en/tutorials/speed/high-performance-animations/ 
Implications to Application Developers 
•Property Animation vs. Atomic Animation?
Agenda 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation
Performance Boosting Thing
“Can u guys add some performance boosting thing on the next version” 
Performance Boosting Thing
“Can u guys add some performance boosting thing on the next version” 
Performance Boosting Thing
“Can u guys add some performance boosting thing on the next version” 
Performance Boosting Thing
“Can u guys add some performance boosting thing on the next version” 
Performance Boosting Thing
PBT == ART 
Source: Google I/O 2014 –The ART Runtime
PBT == ART 
Ahead-Of-Time (AOT) 
Source: Google I/O 2014 –The ART Runtime
PBT == ART 
Ahead-Of-Time (AOT) 
Garbage Collection 
Source: Google I/O 2014 –The ART Runtime
PBT == ART 
Ahead-Of-Time (AOT) 
Garbage Collection 
64-bit Support 
Source: Google I/O 2014 –The ART Runtime
DalvikVM: Register-based 
※Stack, Accumulator, Register machine 
Stackmachine : 0-operand instruction set 
Accumulatormachine : 1-operand … 
Registermachine : 2 or 3-operand … 
000b: iload05 
000d: iload04 
000f: if_icmpge0024 
0012: aload_3 
0013: iload05 
0015: iaload 
0016: istore06 
0018: lload_1 
0019: iload06 
001b: i2l 
001c: ladd 
001d: lstore_1 
001e: iinc05, #+01 
0021: goto000b 
0007: if-gev0, v2, 0010 
0009: aget v1, v8, v0 
000b: int-to-long v5, v1 
000c: add-long/2addr v3, v5 
000d: add-int/lit8 v0, v0, #int 1 
000f: goto0007 
Java VM(JVM) bytecode 
Dalvik VM(DVM) bytecode 
Items 
JVM 
DVM 
bytes 
25 
18 
dispatches 
14 
6 
reads 
45 
19 
writes 
16 
6 
public static long sumArray(int[] arr) { 
long sum = 0; 
For (inti: arr) { 
sum += i; 
} 
return sum; 
}
Just-In-Time Compiler (Froyo~) 
Source: Google I/O 2010 –A JIT Compiler for Android's DalvikVM
Just-In-Time Compiler (Froyo~) 
Source: Google I/O 2010 –A JIT Compiler for Android's DalvikVM 
When to Compile? 
What to Compile?
AOT Compiler (L~) 
Source: Google I/O 2014 –The ART Runtime
AOT Compiler (L~) 
When to Compile? 
What to Compile? 
Source: Google I/O 2014 –The ART Runtime
.art / .oat / .odex 
Source: Google I/O 2014 –The ART Runtime
AOT in Action 
~ 
~ 
~
AOT in Action 
~ 
~ 
~
AOT in Action 
~ 
~ 
~
AOT in Action 
~ 
~ 
~
AOT in Action 
~ 
~ 
~
JIT vs. AOT 
AOT 
Jazelle® 
•Ahead of Time Compilation 
•WIPI의COD (Compile-on- demand) 방식 
•Java bytecode를CPU가바로실행함. (arm/thumb/java mode) 
JIT 
•Just-in-Time Compilation소프트웨어가속하드웨어가속 
•10x ~ 15x 
•6x ~ 10x 
•6x ~ 10x 
•어플리케이션크기가커짐. 
•프로파일링및컴파일시간이있어실행초기느려질수있음. 
►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. 
►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. 
Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표)
JIT vs. AOT 
AOT 
Jazelle® 
•Ahead of Time Compilation 
•WIPI의COD (Compile-on- demand) 방식 
•Java bytecode를CPU가바로실행함. (arm/thumb/java mode) 
JIT 
•Just-in-Time Compilation소프트웨어가속하드웨어가속 
•10x ~ 15x 
•6x ~ 10x 
•6x ~ 10x 
•어플리케이션크기가커짐. 
•프로파일링및컴파일시간이있어실행초기느려질수있음. 
►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. 
►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. 
Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표) 
Speed/Space
JIT vs. AOT 
AOT 
Jazelle® 
•Ahead of Time Compilation 
•WIPI의COD (Compile-on- demand) 방식 
•Java bytecode를CPU가바로실행함. (arm/thumb/java mode) 
JIT 
•Just-in-Time Compilation소프트웨어가속하드웨어가속 
•10x ~ 15x 
•6x ~ 10x 
•6x ~ 10x 
•어플리케이션크기가커짐. 
•프로파일링및컴파일시간이있어실행초기느려질수있음. 
►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. 
►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. 
Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표) 
Optimization Window 
Speed/Space
JIT vs. AOT 
AOT 
Jazelle® 
•Ahead of Time Compilation 
•WIPI의COD (Compile-on- demand) 방식 
•Java bytecode를CPU가바로실행함. (arm/thumb/java mode) 
JIT 
•Just-in-Time Compilation소프트웨어가속하드웨어가속 
•10x ~ 15x 
•6x ~ 10x 
•6x ~ 10x 
•어플리케이션크기가커짐. 
•프로파일링및컴파일시간이있어실행초기느려질수있음. 
►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. 
►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. 
Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표) 
Optimization Window 
Memory Sharing 
Speed/Space
Food for Further Review
Food for Further Review 
Comparison w/ Other Technology/Platforms
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ 
•.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ 
•.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator 
Implications to Application Developers
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ 
•.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator 
Implications to Application Developers 
•Getter/Setter vs. Direct Access to Field?
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ 
•.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator 
Implications to Application Developers 
•Getter/Setter vs. Direct Access to Field? 
•Small vs. Large Method?
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ 
•.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator 
Implications to Application Developers 
•Getter/Setter vs. Direct Access to Field? 
•Small vs. Large Method? 
•Java-only vs. JNI w/ C/C++?
Agenda 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation
Changes in GC: WHY?
Changes in GC: WHY? 
192MBRAM320X480 
2008HTC G1
Changes in GC: WHY? 
1GBRAM 
1280X800 
2011 
Motorola Xoom 
192MBRAM320X480 
2008HTC G1
Changes in GC: WHY? 
1GBRAM 
1280X800 
2011 
Motorola Xoom 
192MBRAM320X480 
2008HTC G1 
2GB/3GBRAM 
2560X1440 
2014LG G3
Changes in GC: WHY? 
Bigger Heaps 
1GBRAM 
1280X800 
2011 
Motorola Xoom 
192MBRAM320X480 
2008HTC G1 
2GB/3GBRAM 
2560X1440 
2014LG G3
Changes in GC: WHY? 
Bigger Heaps 
Longer GC Pauses 
1GBRAM 
1280X800 
2011 
Motorola Xoom 
192MBRAM320X480 
2008HTC G1 
2GB/3GBRAM 
2560X1440 
2014LG G3
Changes in GC: WHY? 
Bigger Heaps 
Longer GC Pauses 
Poor UI Responsiveness 
1GBRAM 
1280X800 
2011 
Motorola Xoom 
192MBRAM320X480 
2008HTC G1 
2GB/3GBRAM 
2560X1440 
2014LG G3
Changes in GC: WHAT?
Changes in GC: WHAT? 
Pre-Gingerbread 
•Stop-the-world 
•Full heap collection 
•Pause time often > 100ms 
Gingerbread to Kitkat 
•Concurrent Mark and Sweep (CMS) 
•Partial collections 
•Pause time usually < 5ms 
Source: Google I/O 2011 –Memory management for Android Apps
Changes in GC: WHAT? 
Pre-Gingerbread 
•Stop-the-world 
•Full heap collection 
•Pause time often > 100ms 
Gingerbread to Kitkat 
•Concurrent Mark and Sweep (CMS) 
•Partial collections 
•Pause time usually < 5ms 
Source: Google I/O 2011 –Memory management for Android Apps 
Serial vs. Parallel 
Concurrent vs. Stop-The-World 
Compacting vs. Non-compacting vs. Copying
Changes in GC: WHAT? 
Pre-Gingerbread 
•Stop-the-world 
•Full heap collection 
•Pause time often > 100ms 
Gingerbread to Kitkat 
•Concurrent Mark and Sweep (CMS) 
•Partial collections 
•Pause time usually < 5ms 
Source: Google I/O 2011 –Memory management for Android Apps 
Serial vs. Parallel 
Concurrent vs. Stop-The-World 
Compacting vs. Non-compacting vs. Copying 
Source: http://www.somanyword.com/2014/01/how- memory-management-garbage-collector-works-in-java- and-difference-types-of-garbage-collectors-in-java/ 
http://www.slideshare.net/dougqh/understanding- garbage-collection 
Understanding Garbage Collection
Changes in GC: WHAT? 
L and Beyond 
•One GC pauseinstead of two 
•Parallelized processing during the remaining GC pause 
•Background stickyconcurrent mark sweep GC: Collector with lower pause time for the special case of cleaning up recently-allocated, short-livedobjects 
•Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases 
Source: Introducing ART (https://source.android.com/devices/tech/dalvik/art.html)
Changes in GC: WHAT? 
L and Beyond 
•One GC pauseinstead of two 
•Parallelized processing during the remaining GC pause 
•Background stickyconcurrent mark sweep GC: Collector with lower pause time for the special case of cleaning up recently-allocated, short-livedobjects 
•Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases 
Source: Introducing ART (https://source.android.com/devices/tech/dalvik/art.html) 
Source: http://en.wikipedia.org/wiki/Human_factors_and_ergonomics 
인간공학(人間工學, ergonomics)이란인간과그들이사용하는물건과의상호작용을다루는학문이다. 인간공학은인간의기계화가아닌인간을위한공학(design for human)을말한다. 즉, 인간의행동, 능력, 한계, 특성등에관한정보를발견하고, 이를도구, 기계, 시스템, 과업, 직무, 환경을설계하는데응용함으로써인간이생산적이고안전하며쾌적한환경에서작업을하고물건을효과적으로이용할수있도록하는것이다. 
[네이버지식백과] 인간공학[Ergonomics] (학문명백과: 공학, 형설출판사)
Changes in GC: WHAT? 
L and Beyond 
•One GC pauseinstead of two 
•Parallelized processing during the remaining GC pause 
•Background stickyconcurrent mark sweep GC: Collector with lower pause time for the special case of cleaning up recently-allocated, short-livedobjects 
•Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases 
Source: Introducing ART (https://source.android.com/devices/tech/dalvik/art.html) 
Source: http://en.wikipedia.org/wiki/Human_factors_and_ergonomics 
인간공학(人間工學, ergonomics)이란인간과그들이사용하는물건과의상호작용을다루는학문이다. 인간공학은인간의기계화가아닌인간을위한공학(design for human)을말한다. 즉, 인간의행동, 능력, 한계, 특성등에관한정보를발견하고, 이를도구, 기계, 시스템, 과업, 직무, 환경을설계하는데응용함으로써인간이생산적이고안전하며쾌적한환경에서작업을하고물건을효과적으로이용할수있도록하는것이다. 
[네이버지식백과] 인간공학[Ergonomics] (학문명백과: 공학, 형설출판사) 
Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine 
http://www.oracle.com/technetwork/java/ gc-tuning-5-138395.html 
Garbage Collector Ergonomicshttp://docs.oracle.com/javase/7/docs/technotes/ guides/vm/gc-ergonomics.html
Two Pauses One Pause 
Source: Google I/O 2014 –The ART runtime
Two Pauses One Pause 
Source: Google I/O 2014 –The ART runtime
Two Pauses One Pause 
Source: Google I/O 2014 –The ART runtime
Long Pause for GC_FOR_ALLOC 
Source: Google I/O 2014 –The ART runtime
Long Pause for GC_FOR_ALLOC 
Source: Google I/O 2014 –The ART runtime
Reducing Heap Fragmentation 
Source: Google I/O 2014 –The ART runtime
Reducing Heap Fragmentation 
Source: Google I/O 2014 –The ART runtime
GC Logs 
GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms 
GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms 
GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms 
GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms 
GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms 
GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms 
GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms 
GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms 
Gingerbread 
L Preview 
Explicitconcurrent mark sweepGC 
freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, 
paused 1.195mstotal 87.219ms 
Backgroundpartialconcurrent mark sweepGC 
freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, 
paused 4.422mstotal 1.371747s 
Backgroundstickyconcurrent mark sweepGC 
freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, 
paused 6.139mstotal 52.868ms 
Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2
GC Logs 
GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms 
GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms 
GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms 
GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms 
GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms 
GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms 
GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms 
GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms 
Gingerbread 
L Preview 
Explicitconcurrent mark sweepGC 
freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, 
paused 1.195mstotal 87.219ms 
Backgroundpartialconcurrent mark sweepGC 
freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, 
paused 4.422mstotal 1.371747s 
Backgroundstickyconcurrent mark sweepGC 
freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, 
paused 6.139mstotal 52.868ms 
Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 
GC Cause 
•Alloc 
•Background 
•Explicit 
•NativeAlloc 
•CollectorTransition 
•DisableMovingGc 
•HomogeneousSpaceCompact 
•HeapTrim
GC Logs 
GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms 
GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms 
GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms 
GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms 
GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms 
GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms 
GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms 
GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms 
Gingerbread 
L Preview 
Explicitconcurrent mark sweepGC 
freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, 
paused 1.195mstotal 87.219ms 
Backgroundpartialconcurrent mark sweepGC 
freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, 
paused 4.422mstotal 1.371747s 
Backgroundstickyconcurrent mark sweepGC 
freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, 
paused 6.139mstotal 52.868ms 
Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 
GC Cause 
•Alloc 
•Background 
•Explicit 
•NativeAlloc 
•CollectorTransition 
•DisableMovingGc 
•HomogeneousSpaceCompact 
•HeapTrim 
GC Type 
•Sticky 
•Partial 
•Full
GC Logs 
GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms 
GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms 
GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms 
GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms 
GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms 
GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms 
GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms 
GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms 
Gingerbread 
L Preview 
Explicitconcurrent mark sweepGC 
freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, 
paused 1.195mstotal 87.219ms 
Backgroundpartialconcurrent mark sweepGC 
freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, 
paused 4.422mstotal 1.371747s 
Backgroundstickyconcurrent mark sweepGC 
freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, 
paused 6.139mstotal 52.868ms 
Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 
GC Cause 
•Alloc 
•Background 
•Explicit 
•NativeAlloc 
•CollectorTransition 
•DisableMovingGc 
•HomogeneousSpaceCompact 
•HeapTrim 
GC Type 
•sticky 
•partial 
•(full) 
Collector Type 
•mark sweep 
•concurrent mark sweep 
•mark compact 
•marksweep+ semispace 
•concurrent copying + mark sweep
GC Logs 
GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms 
GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms 
GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms 
GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms 
GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms 
GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms 
GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms 
GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms 
Gingerbread 
L Preview 
Explicitconcurrent mark sweepGC 
freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, 
paused 1.195mstotal 87.219ms 
Backgroundpartialconcurrent mark sweepGC 
freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, 
paused 4.422mstotal 1.371747s 
Backgroundstickyconcurrent mark sweepGC 
freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, 
paused 6.139mstotal 52.868ms 
Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 
GC Cause 
•Alloc 
•Background 
•Explicit 
•NativeAlloc 
•CollectorTransition 
•DisableMovingGc 
•HomogeneousSpaceCompact 
•HeapTrim 
GC Type 
•sticky 
•partial 
•(full) 
Collector Type 
•mark sweep 
•concurrent mark sweep 
•mark compact 
•marksweep+ semispace 
•concurrent copying + mark sweep
Food for Further Review
Food for Further Review 
Comparison w/ Other Technology/Platforms
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ 
•V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ 
•V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll 
•Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ 
•V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll 
•Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc 
Implications to Application Developers
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ 
•V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll 
•Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc 
Implications to Application Developers 
•Primitive Values vs. Tiny/Short-lived Objects?
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ 
•V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll 
•Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc 
Implications to Application Developers 
•Primitive Values vs. Tiny/Short-lived Objects? 
•Explicit GC w/ System.gc()?
Food for Further Review 
Comparison w/ Other Technology/Platforms 
•Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ 
•V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll 
•Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc 
Implications to Application Developers 
•Primitive Values vs. Tiny/Short-lived Objects? 
•Explicit GC w/ System.gc()? 
•JNI Code Incompatible with Compacting GC
Summary 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation
Summary 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation 
(Software) Engineering is all about
Summary 
①UI Threading Model 
Single UI (Main) Thread UI & Render Thread 
②VM Execution Model 
Just-In-Time Compilation Ahead-Of-Time Compilation 
③Garbage Collection Model 
Less and shorter pauses and less fragmentation 
(Software) Engineering is all about 
TRADE-OFF!!!
Q&A 
THANK YOU

Más contenido relacionado

La actualidad más candente

Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 

La actualidad más candente (20)

Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Deep Learning Edge
Deep Learning Edge Deep Learning Edge
Deep Learning Edge
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
Practice of Android Reverse Engineering
Practice of Android Reverse EngineeringPractice of Android Reverse Engineering
Practice of Android Reverse Engineering
 
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android ApplicationsSteelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
 
Android ndk: Entering the native world
Android ndk: Entering the native worldAndroid ndk: Entering the native world
Android ndk: Entering the native world
 
線上遊戲與雲端運算
線上遊戲與雲端運算線上遊戲與雲端運算
線上遊戲與雲端運算
 
Reverse engineering android apps
Reverse engineering android appsReverse engineering android apps
Reverse engineering android apps
 
Android - Api & Debugging in Android
Android - Api & Debugging in AndroidAndroid - Api & Debugging in Android
Android - Api & Debugging in Android
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
Android ndk
Android ndkAndroid ndk
Android ndk
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)
RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)
RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Cloud Deep Learning Chips Training & Inference
Cloud Deep Learning Chips Training & InferenceCloud Deep Learning Chips Training & Inference
Cloud Deep Learning Chips Training & Inference
 
Toward dynamic analysis of obfuscated android malware
Toward dynamic analysis of obfuscated android malwareToward dynamic analysis of obfuscated android malware
Toward dynamic analysis of obfuscated android malware
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 

Destacado

React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
Yukiya Nakagawa
 

Destacado (13)

Introduction to Skia by Ryan Chou @20141008
Introduction to Skia by Ryan Chou @20141008Introduction to Skia by Ryan Chou @20141008
Introduction to Skia by Ryan Chou @20141008
 
A Detailed Look at Cairo's OpenGL Spans Compositor Performance
A Detailed Look at Cairo's OpenGL Spans Compositor PerformanceA Detailed Look at Cairo's OpenGL Spans Compositor Performance
A Detailed Look at Cairo's OpenGL Spans Compositor Performance
 
Skia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsSkia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics Essentials
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
 
Butter android views
Butter android viewsButter android views
Butter android views
 
Intentの概要
Intentの概要Intentの概要
Intentの概要
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)
 
Hardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for AndroidHardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for Android
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
 

Similar a [1D6]RE-view of Android L developer PRE-view

Core .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsCore .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 Enhancements
Robert MacLean
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
Susan Gold
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
Axway Appcelerator
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
NAVER D2
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
Thomas Conté
 

Similar a [1D6]RE-view of Android L developer PRE-view (20)

Core .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsCore .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 Enhancements
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
 
Introduction to React Native Workshop
Introduction to React Native WorkshopIntroduction to React Native Workshop
Introduction to React Native Workshop
 
Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
 
Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Class[3][5th jun] [three js]
Class[3][5th jun] [three js]
 
Creating Flash Content for Multiple Screens
Creating Flash Content for Multiple ScreensCreating Flash Content for Multiple Screens
Creating Flash Content for Multiple Screens
 
Introduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shiny
 
Rich User Interaction with SVG
Rich User Interaction with SVGRich User Interaction with SVG
Rich User Interaction with SVG
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
Writing videogames with titanium appcelerator
Writing videogames with titanium appceleratorWriting videogames with titanium appcelerator
Writing videogames with titanium appcelerator
 
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014
 
F# And Silverlight
F# And SilverlightF# And Silverlight
F# And Silverlight
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
Criando jogos para o windows 8
Criando jogos para o windows 8Criando jogos para o windows 8
Criando jogos para o windows 8
 
session_01_react_.pptx
session_01_react_.pptxsession_01_react_.pptx
session_01_react_.pptx
 

Más de NAVER D2

Más de NAVER D2 (20)

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

[1D6]RE-view of Android L developer PRE-view

  • 5. Material Design Goals -Create a visual language that synthesizes classic principles of good design with the innovation and possibility of technology and science. -Develop a single underlying system that allows for a unified experience across platforms and device sizes. Mobile precepts are fundamental, but touch, voice, mouse, and keyboard are all first-class input methods. Material is the metaphor Bold, graphic, intentional Motionprovides meaning Principles http://www.google.com/design/spec/material-design/introduction.html
  • 6. Android Runtime https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/
  • 7. Android Runtime https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/ Dalvikis dead, long live Dalvik! DO NOT MERGE
  • 8. Android Runtime https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/ Dalvikis dead, long live Dalvik! DO NOT MERGE
  • 9. Android Runtime https://android-review.googlesource.com/#/c/98553/ https://android-review.googlesource.com/#/c/98374/ Dalvikis dead, long live Dalvik! DO NOT MERGE
  • 11. Key Architectural Changes in L ①UI Threading Model Single UI (Main) Thread UI & Render Thread
  • 12. Key Architectural Changes in L ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation
  • 13. Key Architectural Changes in L ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation
  • 14. Agenda ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation
  • 15. Render Thread in L http://www.youtube.com/watch?v=3TtVsy98ces ① ① ②
  • 16. Render Thread in L http://www.youtube.com/watch?v=3TtVsy98ces ②
  • 17. Render Thread in L http://www.youtube.com/watch?v=3TtVsy98ces
  • 18. Render Thread in L http://www.youtube.com/watch?v=3TtVsy98ces One of the most exciting topics that was glossed over was the introduction of a dedicatedrender thread. The goal of the render threadis to take many of the atomic animationsintroduced with material designand perform them autonomously, so they don’t hold up the primary UI toolkit thread. Source: http://www.willowtreeapps.com/blog/google-io-from-the- trenches-android-l-and-material-design/
  • 19. UI (Main) Thread Activity ThreadHelloAndroid.apk Activity Looper Message Queue Service BroadcastReceiver ContentProvider H handleMessage() ViewRootImpl handleMessage() TLS Threaded Task Binder Object Storage (File,Prefs,DB,Network) Window Android Manifest.xml Resources Intent Views Views Views Application Instrumentation test.apk Test Case
  • 20. Looper, Message Queue, and Handler
  • 21. GPUI -UI on the GPU (Honeycomb~) Source: Google I/O 2011 –Accelerated Android Rendering
  • 22. GPUI -UI on the GPU (Honeycomb~) Source: Google I/O 2011 –Accelerated Android Rendering CPU Rasterization GPU Composition
  • 23. GPUI -UI on the GPU (Honeycomb~) Increased Number of Pixels Source: Google I/O 2011 –Accelerated Android Rendering CPU Rasterization GPU Composition
  • 24. GPUI -UI on the GPU (Honeycomb~) Increased Number of Pixels Source: Google I/O 2011 –Accelerated Android Rendering CPU Rasterization GPU Composition GPU RasterizationGPU Composition
  • 25. GPUI -UI on the GPU (Honeycomb~) GPUI Display List View Layers Display List Properties Increased Number of Pixels Source: Google I/O 2011 –Accelerated Android Rendering … CPU Rasterization GPU Composition GPU RasterizationGPU Composition
  • 26. Display List A display list records a series of graphics related operation and can replay them later. Display lists are usually built by recording operations on a android.graphics.Canvas. Replaying the operations from a display list avoids executing views drawing code on every frame, and is thus much more efficient. DisplayList::Op[Non-Drawing] <<enumeration>> +Sav e +Restore +RestoreToCount +Sav eLayer +Sav eLayerAlpha +Translate +Rotate +Scale +Skew +SetMatrix +ConcatMatrix +ClipRect DisplayList::Op[Drawing] <<enumeration>> +DrawDisplayList +DrawLayer +DrawBitmap +DrawBitmapMatrix +DrawBitmapRect +DrawBitmapData +DrawBitmapMesh +DrawPatch +DrawColor +DrawRect +DrawRoundRect +DrawCircle +DrawOv al +DrawArc +DrawPath +DrawLines +DrawPoints +DrawText +DrawTextOnPath +DrawPosText +ResetShader +SetupShader +ResetColorFilter +SetupColorFilter +ResetShadow +SetupShadow +ResetPaintFilter +SetupPaintFilter +DrawGLFunction OpenGLRenderer drawDisplayList(…) DisplayList replay(…) DisplayListRenderer draw*(…, SkPaint) void* buffer SkWriter32 write*(…) SkReader32 read*() GLES20RecordingCanvas draw*(…, Paint) android_view_ GLES20Canvas_draw*(…) GLES20Canvas drawDisplayList(…) draw*(…, SkPaint) GLES2/gl2.h glXXX(…) Source: 10th Kandroid Conference – Skia and FreeType: Android 2D Graphics Essentials
  • 27. Display List A display list records a series of graphics related operation and can replay them later. Display lists are usually built by recording operations on a android.graphics.Canvas. Replaying the operations from a display list avoids executing views drawing code on every frame, and is thus much more efficient. DisplayList::Op[Non-Drawing] <<enumeration>> +Sav e +Restore +RestoreToCount +Sav eLayer +Sav eLayerAlpha +Translate +Rotate +Scale +Skew +SetMatrix +ConcatMatrix +ClipRect DisplayList::Op[Drawing] <<enumeration>> +DrawDisplayList +DrawLayer +DrawBitmap +DrawBitmapMatrix +DrawBitmapRect +DrawBitmapData +DrawBitmapMesh +DrawPatch +DrawColor +DrawRect +DrawRoundRect +DrawCircle +DrawOv al +DrawArc +DrawPath +DrawLines +DrawPoints +DrawText +DrawTextOnPath +DrawPosText +ResetShader +SetupShader +ResetColorFilter +SetupColorFilter +ResetShadow +SetupShadow +ResetPaintFilter +SetupPaintFilter +DrawGLFunction OpenGLRenderer drawDisplayList(…) DisplayList replay(…) DisplayListRenderer draw*(…, SkPaint) void* buffer SkWriter32 write*(…) SkReader32 read*() GLES20RecordingCanvas draw*(…, Paint) android_view_ GLES20Canvas_draw*(…) GLES20Canvas drawDisplayList(…) draw*(…, SkPaint) GLES2/gl2.h glXXX(…) Source: 10th Kandroid Conference – Skia and FreeType: Android 2D Graphics Essentials
  • 28. Display List: An Example DrawDisplayList DrawPatch Save Translate ConcatMatrix DrawBitmap RestoreToCount $ adbshell dumpsysgfxinfo[pid|pname] JB (API Level 18) Source: 12thKandroid Conference –Terminology and History of Android Performance Features
  • 29. Android Animation DrawableAnimation Frame(-by-Frame) Animation View Animation Tween(ed)Animation Property Animation What Showing a sequence of images in order Performing a series of transformations on a single image Modifying an object's property values over a set period of time Added/ Updated 1 1, 4 11, 16,18, 19 APIs android.graphics.drawable. AnimationDrawable android.view.animation.* android.animation.* (2011/02) Animation in Honeycombhttp://android-developers.blogspot.kr/2011/02/animation-in-honeycomb.html (2011/05) Introducing ViewPropertyAnimatorhttp://android-developers.blogspot.kr/2011/05/introducing-viewpropertyanimator.html (2011/11) Android 4.0 Graphics and Animationshttp://android-developers.blogspot.kr/2011/11/android-40-graphics-and-animations.html Source: 13thKandroid MinMax–Silky Rendering Choreographer and Animation
  • 30. Property Animation (Pre-Jellybean) Source: 13thKandroid MinMax–Silky Rendering Choreographer and Animation ValueAnimator doAnimationFrame() TimeInterpolatorgetInterpolation() Elapsed Fraction TypeEvaluator evaluate() Interpolated Fraction Current Value Frame Time ( Frame Time –Start Time ) / Duration Math.pow( Elapsed Fraction, 2 Factor ) e.g., AccelerateInterpolator AnimatorUpdateListener onAimationUpdate() Start Value+ ( End Value–Start Value )  Interpolated Fraction Thread Local Storage sendEmptyMessageDelayed() w/ ANIMATION_FRAME handleMessage() sendEmptyMessage() w/ ANIMATION_START AnimationHandler start() 1 2 3 4 5 6 7 8
  • 31. Drawing w/ Single UI Thread Activity SurfaceFlinger Event Set Property Value Invalidate Measure & Layout Prepare Draw Update DisplayList Draw DisplayList Swap Buffers Display List Dequeue Buffer Composite Windows Post Buffer Enqueue Buffer Something Happens Draw Display
  • 32. Drawing w/ UI & Render Threads Activity SurfaceFlinger Event Set Property Value Invalidate Measure & Layout Prepare Draw Update DisplayList Draw DisplayList Swap Buffers Display List Dequeue Buffer Composite Windows Post Buffer Enqueue Buffer Something Happens Draw Display Render Thread
  • 33. Threads in Action Threads in KitKat
  • 34. Threads in Action Threads in KitKat
  • 35. Threads in Action Threads in KitKat Threads in L
  • 36. Threads in Action Threads in KitKat Threads in L
  • 38. Food for Further Review Comparison w/ Other Technology/Platforms
  • 39. Food for Further Review Comparison w/ Other Technology/Platforms •Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx
  • 40. Food for Further Review Comparison w/ Other Technology/Platforms •Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx •Web Animations: Javascript-based vs. CSS-basedhttp://www.html5rocks.com/en/tutorials/speed/high-performance-animations/
  • 41. Food for Further Review Comparison w/ Other Technology/Platforms •Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx •Web Animations: Javascript-based vs. CSS-basedhttp://www.html5rocks.com/en/tutorials/speed/high-performance-animations/ Implications to Application Developers
  • 42. Food for Further Review Comparison w/ Other Technology/Platforms •Windows Phone: UI & Compositor Thread, Storyboard-based vs. Timer-based Animationshttp://blogs.telerik.com/windowsphoneteam/posts/10-12-13/ui-vs-compositor-demystifying-the- main-windows-phone-7-os-threads.aspx •Web Animations: Javascript-based vs. CSS-basedhttp://www.html5rocks.com/en/tutorials/speed/high-performance-animations/ Implications to Application Developers •Property Animation vs. Atomic Animation?
  • 43. Agenda ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation
  • 45. “Can u guys add some performance boosting thing on the next version” Performance Boosting Thing
  • 46. “Can u guys add some performance boosting thing on the next version” Performance Boosting Thing
  • 47. “Can u guys add some performance boosting thing on the next version” Performance Boosting Thing
  • 48. “Can u guys add some performance boosting thing on the next version” Performance Boosting Thing
  • 49. PBT == ART Source: Google I/O 2014 –The ART Runtime
  • 50. PBT == ART Ahead-Of-Time (AOT) Source: Google I/O 2014 –The ART Runtime
  • 51. PBT == ART Ahead-Of-Time (AOT) Garbage Collection Source: Google I/O 2014 –The ART Runtime
  • 52. PBT == ART Ahead-Of-Time (AOT) Garbage Collection 64-bit Support Source: Google I/O 2014 –The ART Runtime
  • 53. DalvikVM: Register-based ※Stack, Accumulator, Register machine Stackmachine : 0-operand instruction set Accumulatormachine : 1-operand … Registermachine : 2 or 3-operand … 000b: iload05 000d: iload04 000f: if_icmpge0024 0012: aload_3 0013: iload05 0015: iaload 0016: istore06 0018: lload_1 0019: iload06 001b: i2l 001c: ladd 001d: lstore_1 001e: iinc05, #+01 0021: goto000b 0007: if-gev0, v2, 0010 0009: aget v1, v8, v0 000b: int-to-long v5, v1 000c: add-long/2addr v3, v5 000d: add-int/lit8 v0, v0, #int 1 000f: goto0007 Java VM(JVM) bytecode Dalvik VM(DVM) bytecode Items JVM DVM bytes 25 18 dispatches 14 6 reads 45 19 writes 16 6 public static long sumArray(int[] arr) { long sum = 0; For (inti: arr) { sum += i; } return sum; }
  • 54. Just-In-Time Compiler (Froyo~) Source: Google I/O 2010 –A JIT Compiler for Android's DalvikVM
  • 55. Just-In-Time Compiler (Froyo~) Source: Google I/O 2010 –A JIT Compiler for Android's DalvikVM When to Compile? What to Compile?
  • 56. AOT Compiler (L~) Source: Google I/O 2014 –The ART Runtime
  • 57. AOT Compiler (L~) When to Compile? What to Compile? Source: Google I/O 2014 –The ART Runtime
  • 58. .art / .oat / .odex Source: Google I/O 2014 –The ART Runtime
  • 59. AOT in Action ~ ~ ~
  • 60. AOT in Action ~ ~ ~
  • 61. AOT in Action ~ ~ ~
  • 62. AOT in Action ~ ~ ~
  • 63. AOT in Action ~ ~ ~
  • 64. JIT vs. AOT AOT Jazelle® •Ahead of Time Compilation •WIPI의COD (Compile-on- demand) 방식 •Java bytecode를CPU가바로실행함. (arm/thumb/java mode) JIT •Just-in-Time Compilation소프트웨어가속하드웨어가속 •10x ~ 15x •6x ~ 10x •6x ~ 10x •어플리케이션크기가커짐. •프로파일링및컴파일시간이있어실행초기느려질수있음. ►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. ►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표)
  • 65. JIT vs. AOT AOT Jazelle® •Ahead of Time Compilation •WIPI의COD (Compile-on- demand) 방식 •Java bytecode를CPU가바로실행함. (arm/thumb/java mode) JIT •Just-in-Time Compilation소프트웨어가속하드웨어가속 •10x ~ 15x •6x ~ 10x •6x ~ 10x •어플리케이션크기가커짐. •프로파일링및컴파일시간이있어실행초기느려질수있음. ►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. ►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표) Speed/Space
  • 66. JIT vs. AOT AOT Jazelle® •Ahead of Time Compilation •WIPI의COD (Compile-on- demand) 방식 •Java bytecode를CPU가바로실행함. (arm/thumb/java mode) JIT •Just-in-Time Compilation소프트웨어가속하드웨어가속 •10x ~ 15x •6x ~ 10x •6x ~ 10x •어플리케이션크기가커짐. •프로파일링및컴파일시간이있어실행초기느려질수있음. ►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. ►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표) Optimization Window Speed/Space
  • 67. JIT vs. AOT AOT Jazelle® •Ahead of Time Compilation •WIPI의COD (Compile-on- demand) 방식 •Java bytecode를CPU가바로실행함. (arm/thumb/java mode) JIT •Just-in-Time Compilation소프트웨어가속하드웨어가속 •10x ~ 15x •6x ~ 10x •6x ~ 10x •어플리케이션크기가커짐. •프로파일링및컴파일시간이있어실행초기느려질수있음. ►모바일단말에서는JIT와Jazelle® 사용이일반화되어있음. ►어플리케이션크기가커지는것을제외하면, AOT 방식이최대성능을보일수있음. Source: 1stkandroidSeminar–DalvikVM vs. Java VM (류혁곤님발표) Optimization Window Memory Sharing Speed/Space
  • 69. Food for Further Review Comparison w/ Other Technology/Platforms
  • 70. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/
  • 71. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ •.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator
  • 72. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ •.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator Implications to Application Developers
  • 73. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ •.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator Implications to Application Developers •Getter/Setter vs. Direct Access to Field?
  • 74. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ •.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator Implications to Application Developers •Getter/Setter vs. Direct Access to Field? •Small vs. Large Method?
  • 75. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: JIT and (Full) AOThttp://www.mono-project.com/docs/advanced/aot/ •.NET: NGenhttp://blogs.msdn.com/b/clrcodegeneration/archive/2010/04/27/ngen-walk-through-series.aspxhttp://en.wikipedia.org/wiki/Native_Image_Generator Implications to Application Developers •Getter/Setter vs. Direct Access to Field? •Small vs. Large Method? •Java-only vs. JNI w/ C/C++?
  • 76. Agenda ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation
  • 78. Changes in GC: WHY? 192MBRAM320X480 2008HTC G1
  • 79. Changes in GC: WHY? 1GBRAM 1280X800 2011 Motorola Xoom 192MBRAM320X480 2008HTC G1
  • 80. Changes in GC: WHY? 1GBRAM 1280X800 2011 Motorola Xoom 192MBRAM320X480 2008HTC G1 2GB/3GBRAM 2560X1440 2014LG G3
  • 81. Changes in GC: WHY? Bigger Heaps 1GBRAM 1280X800 2011 Motorola Xoom 192MBRAM320X480 2008HTC G1 2GB/3GBRAM 2560X1440 2014LG G3
  • 82. Changes in GC: WHY? Bigger Heaps Longer GC Pauses 1GBRAM 1280X800 2011 Motorola Xoom 192MBRAM320X480 2008HTC G1 2GB/3GBRAM 2560X1440 2014LG G3
  • 83. Changes in GC: WHY? Bigger Heaps Longer GC Pauses Poor UI Responsiveness 1GBRAM 1280X800 2011 Motorola Xoom 192MBRAM320X480 2008HTC G1 2GB/3GBRAM 2560X1440 2014LG G3
  • 84. Changes in GC: WHAT?
  • 85. Changes in GC: WHAT? Pre-Gingerbread •Stop-the-world •Full heap collection •Pause time often > 100ms Gingerbread to Kitkat •Concurrent Mark and Sweep (CMS) •Partial collections •Pause time usually < 5ms Source: Google I/O 2011 –Memory management for Android Apps
  • 86. Changes in GC: WHAT? Pre-Gingerbread •Stop-the-world •Full heap collection •Pause time often > 100ms Gingerbread to Kitkat •Concurrent Mark and Sweep (CMS) •Partial collections •Pause time usually < 5ms Source: Google I/O 2011 –Memory management for Android Apps Serial vs. Parallel Concurrent vs. Stop-The-World Compacting vs. Non-compacting vs. Copying
  • 87. Changes in GC: WHAT? Pre-Gingerbread •Stop-the-world •Full heap collection •Pause time often > 100ms Gingerbread to Kitkat •Concurrent Mark and Sweep (CMS) •Partial collections •Pause time usually < 5ms Source: Google I/O 2011 –Memory management for Android Apps Serial vs. Parallel Concurrent vs. Stop-The-World Compacting vs. Non-compacting vs. Copying Source: http://www.somanyword.com/2014/01/how- memory-management-garbage-collector-works-in-java- and-difference-types-of-garbage-collectors-in-java/ http://www.slideshare.net/dougqh/understanding- garbage-collection Understanding Garbage Collection
  • 88. Changes in GC: WHAT? L and Beyond •One GC pauseinstead of two •Parallelized processing during the remaining GC pause •Background stickyconcurrent mark sweep GC: Collector with lower pause time for the special case of cleaning up recently-allocated, short-livedobjects •Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases Source: Introducing ART (https://source.android.com/devices/tech/dalvik/art.html)
  • 89. Changes in GC: WHAT? L and Beyond •One GC pauseinstead of two •Parallelized processing during the remaining GC pause •Background stickyconcurrent mark sweep GC: Collector with lower pause time for the special case of cleaning up recently-allocated, short-livedobjects •Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases Source: Introducing ART (https://source.android.com/devices/tech/dalvik/art.html) Source: http://en.wikipedia.org/wiki/Human_factors_and_ergonomics 인간공학(人間工學, ergonomics)이란인간과그들이사용하는물건과의상호작용을다루는학문이다. 인간공학은인간의기계화가아닌인간을위한공학(design for human)을말한다. 즉, 인간의행동, 능력, 한계, 특성등에관한정보를발견하고, 이를도구, 기계, 시스템, 과업, 직무, 환경을설계하는데응용함으로써인간이생산적이고안전하며쾌적한환경에서작업을하고물건을효과적으로이용할수있도록하는것이다. [네이버지식백과] 인간공학[Ergonomics] (학문명백과: 공학, 형설출판사)
  • 90. Changes in GC: WHAT? L and Beyond •One GC pauseinstead of two •Parallelized processing during the remaining GC pause •Background stickyconcurrent mark sweep GC: Collector with lower pause time for the special case of cleaning up recently-allocated, short-livedobjects •Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases Source: Introducing ART (https://source.android.com/devices/tech/dalvik/art.html) Source: http://en.wikipedia.org/wiki/Human_factors_and_ergonomics 인간공학(人間工學, ergonomics)이란인간과그들이사용하는물건과의상호작용을다루는학문이다. 인간공학은인간의기계화가아닌인간을위한공학(design for human)을말한다. 즉, 인간의행동, 능력, 한계, 특성등에관한정보를발견하고, 이를도구, 기계, 시스템, 과업, 직무, 환경을설계하는데응용함으로써인간이생산적이고안전하며쾌적한환경에서작업을하고물건을효과적으로이용할수있도록하는것이다. [네이버지식백과] 인간공학[Ergonomics] (학문명백과: 공학, 형설출판사) Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine http://www.oracle.com/technetwork/java/ gc-tuning-5-138395.html Garbage Collector Ergonomicshttp://docs.oracle.com/javase/7/docs/technotes/ guides/vm/gc-ergonomics.html
  • 91. Two Pauses One Pause Source: Google I/O 2014 –The ART runtime
  • 92. Two Pauses One Pause Source: Google I/O 2014 –The ART runtime
  • 93. Two Pauses One Pause Source: Google I/O 2014 –The ART runtime
  • 94. Long Pause for GC_FOR_ALLOC Source: Google I/O 2014 –The ART runtime
  • 95. Long Pause for GC_FOR_ALLOC Source: Google I/O 2014 –The ART runtime
  • 96. Reducing Heap Fragmentation Source: Google I/O 2014 –The ART runtime
  • 97. Reducing Heap Fragmentation Source: Google I/O 2014 –The ART runtime
  • 98. GC Logs GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms Gingerbread L Preview Explicitconcurrent mark sweepGC freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, paused 1.195mstotal 87.219ms Backgroundpartialconcurrent mark sweepGC freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, paused 4.422mstotal 1.371747s Backgroundstickyconcurrent mark sweepGC freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, paused 6.139mstotal 52.868ms Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2
  • 99. GC Logs GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms Gingerbread L Preview Explicitconcurrent mark sweepGC freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, paused 1.195mstotal 87.219ms Backgroundpartialconcurrent mark sweepGC freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, paused 4.422mstotal 1.371747s Backgroundstickyconcurrent mark sweepGC freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, paused 6.139mstotal 52.868ms Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 GC Cause •Alloc •Background •Explicit •NativeAlloc •CollectorTransition •DisableMovingGc •HomogeneousSpaceCompact •HeapTrim
  • 100. GC Logs GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms Gingerbread L Preview Explicitconcurrent mark sweepGC freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, paused 1.195mstotal 87.219ms Backgroundpartialconcurrent mark sweepGC freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, paused 4.422mstotal 1.371747s Backgroundstickyconcurrent mark sweepGC freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, paused 6.139mstotal 52.868ms Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 GC Cause •Alloc •Background •Explicit •NativeAlloc •CollectorTransition •DisableMovingGc •HomogeneousSpaceCompact •HeapTrim GC Type •Sticky •Partial •Full
  • 101. GC Logs GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms Gingerbread L Preview Explicitconcurrent mark sweepGC freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, paused 1.195mstotal 87.219ms Backgroundpartialconcurrent mark sweepGC freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, paused 4.422mstotal 1.371747s Backgroundstickyconcurrent mark sweepGC freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, paused 6.139mstotal 52.868ms Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 GC Cause •Alloc •Background •Explicit •NativeAlloc •CollectorTransition •DisableMovingGc •HomogeneousSpaceCompact •HeapTrim GC Type •sticky •partial •(full) Collector Type •mark sweep •concurrent mark sweep •mark compact •marksweep+ semispace •concurrent copying + mark sweep
  • 102. GC Logs GC_HPROF_DUMP_HEAP freed 47K, 50% free 2730K/5379K, external 8825K/9762K, paused 2262ms GC_EXPLICIT freed 39K, 49% free 3434K/6727K, external 1625K/2137K, paused 61ms GC_EXTERNAL_ALLOC freed 113K, 48% free 2849K/5447K, external 2069K/2137K, paused 29ms GC_FOR_MALLOC freed 672K, 46% free 4505K/8263K, external 1625K/2137K, paused 36ms GC_EXPLICIT freed 298K,5% free 9395K/9820K, paused 5ms+4ms, total 46ms GC_FOR_ALLOC freed 62K, 4% free 9981K/10356K, paused 14ms, total 14ms GC_CONCURRENT freed 452K, 5% free 11442K/11924K, paused 2ms+3ms, total 32ms GC_BEFORE_OOM freed <1K, 25% free 48653K/64327K, paused 20ms Gingerbread L Preview Explicitconcurrent mark sweepGC freed 65595(3MB) AllocSpaceobjects, 9(4MB) LOS objects, 810% free, 38MB/58MB, paused 1.195mstotal 87.219ms Backgroundpartialconcurrent mark sweepGC freed 74626(3MB) AllocSpaceobjects, 39(4MB) LOS objects, 1496% free, 25MB/32MB, paused 4.422mstotal 1.371747s Backgroundstickyconcurrent mark sweepGC freed 70319(3MB) AllocSpaceobjects, 59(5MB) LOS objects, 825% free, 49MB/56MB, paused 6.139mstotal 52.868ms Source : http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/2 GC Cause •Alloc •Background •Explicit •NativeAlloc •CollectorTransition •DisableMovingGc •HomogeneousSpaceCompact •HeapTrim GC Type •sticky •partial •(full) Collector Type •mark sweep •concurrent mark sweep •mark compact •marksweep+ semispace •concurrent copying + mark sweep
  • 103. Food for Further Review
  • 104. Food for Further Review Comparison w/ Other Technology/Platforms
  • 105. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/
  • 106. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ •V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll
  • 107. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ •V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll •Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc
  • 108. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ •V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll •Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc Implications to Application Developers
  • 109. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ •V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll •Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc Implications to Application Developers •Primitive Values vs. Tiny/Short-lived Objects?
  • 110. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ •V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll •Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc Implications to Application Developers •Primitive Values vs. Tiny/Short-lived Objects? •Explicit GC w/ System.gc()?
  • 111. Food for Further Review Comparison w/ Other Technology/Platforms •Mono: SGen Garbage Collectorhttp://www.mono-project.com/docs/advanced/garbage-collector/sgen/ •V8: Stop-the-world, Generational, Accurate Garbage Collectorhttps://developers.google.com/v8/design#garb_coll •Blink: Garbage Collection for Blink C++ objects (a.k.a. Oilpan) http://www.chromium.org/blink/blink-gc Implications to Application Developers •Primitive Values vs. Tiny/Short-lived Objects? •Explicit GC w/ System.gc()? •JNI Code Incompatible with Compacting GC
  • 112. Summary ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation
  • 113. Summary ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation (Software) Engineering is all about
  • 114. Summary ①UI Threading Model Single UI (Main) Thread UI & Render Thread ②VM Execution Model Just-In-Time Compilation Ahead-Of-Time Compilation ③Garbage Collection Model Less and shorter pauses and less fragmentation (Software) Engineering is all about TRADE-OFF!!!