SlideShare a Scribd company logo
1 of 27
Download to read offline
Dr. Low Latency or: How I Learned to Stop
Worrying about Pauses and Love the
Memory Heap

@author Jaromir Hamala, jhamala@c2b2.co.uk
@author(type=Twitter) @jerrinot

© C2B2 Consulting Limited 2013
All Rights Reserved
Who Am I?
■ Jaromir Hamala
■ A curious developer
■ Who likes to break play with stuff

© C2B2 Consulting Limited 2013
All Rights Reserved
Safe Harbor
This talk may contain non-sense!

© C2B2 Consulting Limited 2013
All Rights Reserved
Facts
• Memory is Cheap
• We have a lot of data
• Data in Memory == Fastest Possible Data (apart from CPU
caches)

http://www.npr.org/blogs/thetwo-way/2012/06/06/154416480/ho-hum-dull-and-boring-are-now-a-pair

© C2B2 Consulting Limited 2013
All Rights Reserved
On-Heap Allocation
• CoolObject cool = new CoolObject()
• Great:
– It’s easy and usually *very* fast!
• Allocation can be actually faster than in C

– GC goodies!

• Not so great:
– GC leads to Stop-the-World Pauses
– Bigger Heap -> Longer Pauses
© C2B2 Consulting Limited 2013
All Rights Reserved
© C2B2 Consulting Limited 2013
All Rights Reserved
© C2B2 Consulting Limited 2013
All Rights Reserved
Why to go Off-Heap?
• Latency caused by GC
• Locality
• Sharing with non-Java

http://digboston.com/boston-lulz/2013/08/trolley-trollop-first-comes-love/attachment/why-god-why-kitten1/

© C2B2 Consulting Limited 2013
All Rights Reserved
GC Implementations
•

(Old Gen)

GC in HotSpot (Oracle/Sun JDK, OpenJDK)

– ParOld – STW pauses by design!
– CMS – fragmentation -> STW pause
– G1 – Immature (yet?), not fulfilling the expectations ->
occasional STW pauses

© C2B2 Consulting Limited 2013
All Rights Reserved
Latency can kill you!

© C2B2 Consulting Limited 2013
All Rights Reserved
What is Off-Heap?
• Area of memory not maintained by GC
– Manual memory control

• No Notion of Java object
– serialization

http://nickshell1983.wordpress.com/2010/06/29/taking-a-god-nudged-leap-of-faith/

© C2B2 Consulting Limited 2013
All Rights Reserved
Off-Heap Options?
•
•
•
•
•

Direct Memory Buffer
sun.misc.Unsafe
JNI
Memory Mapped File
….

http://en.wikipedia.org/wiki/File:Road_to_Hell_One_Sheet.jpg

© C2B2 Consulting Limited 2013
All Rights Reserved
Direct Memory Buffer
• ByteBuffer directBuf =
ByteBuffer.allocateDirect(int noBytes);

•
•
•
•

Part of Java NIO
Max. 2GB / buffer
Pure Java = Portable
getX()/putX() methods

© C2B2 Consulting Limited 2013
All Rights Reserved
sun.misc.Unsafe
– long addr = unsafe.allocateMemory(noBytes)

– Not a standardized part of JDK!
– Implemented by most JVM vendors
• Sun / Oracle / IBM

– It can disappear from JDK without warning!

© C2B2 Consulting Limited 2013
All Rights Reserved
Cassandra I.
public class NativeAllocator implements IAllocator
{
static final Unsafe unsafe;
static {
try {
Field field = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
unsafe = (sun.misc.Unsafe) field.get(null);
}
catch (Exception e) {
throw new AssertionError(e);
}
}
public long allocate(long size) {
return unsafe.allocateMemory(size);
}
public void free(long peer) {
unsafe.freeMemory(peer);
}
}

© C2B2 Consulting Limited 2013
All Rights Reserved
JNI
• Java Native Interface
• Native library means worst portability
between platforms
• JNI Overhead
• Can re-use already existing (native) allocator

© C2B2 Consulting Limited 2013
All Rights Reserved
Cassandra II.
• Java Native Interface via JNA
public class JEMallocAllocator implements IAllocator {
public interface JEMLibrary extends Library {
long malloc(long size);
void free(long pointer);
}
private final JEMLibrary library;
public JEMallocAllocator() {
library = (JEMLibrary) Native.loadLibrary("jemalloc", JEMLibrary.class);
}
public long allocate(long size) {
return library.malloc(size);
}
public void free(long peer) {
library.free(peer);
}
}
© C2B2 Consulting Limited 2013
All Rights Reserved
Memory Mapped File
•
•
•
•

Part of NIO
Pure Java -> Portable
Allows sharing data between processes
Persisted by OS

© C2B2 Consulting Limited 2013
All Rights Reserved
Javin Paul,
http://javarevisited.blogspot.com/2012/01/memorymapped-file-and-io-in-java.html
private static int count = 1010241024; //10 MB

public static void main(String[] args) throws Exception {
RandomAccessFile memoryMappedFile = new RandomAccessFile("largeFile.txt", "rw");
//Mapping a file into memory
MappedByteBuffer out = memoryMappedFile.getChannel().map(FileChannel.MapMode.READ_WRITE, 0,
count);
//Writing into Memory Mapped File
for (int i = 0; i < count; i++) {
out.put((byte) 'A');
}
System.out.println("Writing to Memory Mapped File is completed");

//reading from memory file in Java
for (int i = 0; i < 10 ; i++) {
System.out.print((char) out.get(i));
}
System.out.println("Reading from Memory Mapped File is completed");
}

© C2B2 Consulting Limited 2013
All Rights Reserved
Use cases for Off-Heap?
• Caches / Data Grids
– A lot of data
– Objects with well defined lifecycle

• (Extremely) Latency-Sensitive tasks
– High-Frequency trading…

• Sharing Data with non-Java
© C2B2 Consulting Limited 2013
All Rights Reserved
Apache DirectMemory
• “…is a off-heap cache for the Java Virtual
Machine”
• Easy to integrate
• Friendly License
• Experimental
• http://directmemory.apache.org/

© C2B2 Consulting Limited 2013
All Rights Reserved
DirectMemory Usage
CacheService<Object, Object> cacheService =
new DirectMemory<Object, Object>()
.setNumberOfBuffers( 10 )
.setSize( 1000 )
.setInitialCapacity( 100000 )
.setConcurrencyLevel( 4 )
.newCacheService();

put( K key, V value )
put( K key, V value, int expiresIn )

© C2B2 Consulting Limited 2013
All Rights Reserved
Is Off-Heap The Future of Java?
• Oh God! Please no!
• R&D should be aimed to more effective GC
– Zing JVM (based on HotSpot, C4 - the fully
concurrent GC)
– RedHat Shenandoah?

© C2B2 Consulting Limited 2013
All Rights Reserved
Final Warning(s)
• Stay On-Heap unless you have
no other choice!
• If you think you have no other
choice, think twice
• Do NOT re-invent the wheel!
(Memory Management)
• Measure, measure, measure!

© C2B2 Consulting Limited 2013
All Rights Reserved
Further Sources
• http://mechanical-sympathy.blogspot.com/
– Martin Thompson. There is a brilliant mailing list as well!

• http://psy-lob-saw.blogspot.com
– Nitsan Wakart

• http://vanillajava.blogspot.com
– Peter Lawrey

• http://insightfullogic.com/blog/
– Richard Warburton

• http://ashkrit.blogspot.com
– Ashkrit

© C2B2 Consulting Limited 2013
All Rights Reserved
© C2B2 Consulting Limited 2013
All Rights Reserved
Thank you

© C2B2 Consulting Limited 2013
All Rights Reserved

More Related Content

Viewers also liked

Davoxx 2012 - 'JMS 2.0 Update'
Davoxx 2012 - 'JMS 2.0 Update'Davoxx 2012 - 'JMS 2.0 Update'
Davoxx 2012 - 'JMS 2.0 Update'C2B2 Consulting
 
JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning
JudCon 2010 Berlin: Practical Enterprise Java Performance TuningJudCon 2010 Berlin: Practical Enterprise Java Performance Tuning
JudCon 2010 Berlin: Practical Enterprise Java Performance TuningC2B2 Consulting
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?C2B2 Consulting
 
Novo apendice ii_do_anexo_i_2013-11-14_10_15_08
Novo apendice ii_do_anexo_i_2013-11-14_10_15_08Novo apendice ii_do_anexo_i_2013-11-14_10_15_08
Novo apendice ii_do_anexo_i_2013-11-14_10_15_08Resgate Cambuí
 
Resenha espirita on line 99
Resenha espirita on line 99Resenha espirita on line 99
Resenha espirita on line 99MRS
 
GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy C2B2 Consulting
 
London JBUG – We’re back!
London JBUG – We’re back!London JBUG – We’re back!
London JBUG – We’re back!C2B2 Consulting
 
JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge
JUDCon London 2011 - Elastic SOA on the Cloud, Steve MillidgeJUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge
JUDCon London 2011 - Elastic SOA on the Cloud, Steve MillidgeC2B2 Consulting
 
Coherence For Extreme Performance, Availablity and Scalability
Coherence For Extreme Performance, Availablity and ScalabilityCoherence For Extreme Performance, Availablity and Scalability
Coherence For Extreme Performance, Availablity and ScalabilityC2B2 Consulting
 
Infinispan from POC to Production
Infinispan from POC to ProductionInfinispan from POC to Production
Infinispan from POC to ProductionC2B2 Consulting
 
Large Scale Migration from WebLogic to JBoss
Large Scale Migration from WebLogic to JBossLarge Scale Migration from WebLogic to JBoss
Large Scale Migration from WebLogic to JBossC2B2 Consulting
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' C2B2 Consulting
 
Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...
Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...
Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...C2B2 Consulting
 
Monitoring and Tuning GlassFish
Monitoring and Tuning GlassFishMonitoring and Tuning GlassFish
Monitoring and Tuning GlassFishC2B2 Consulting
 
Programming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and GrizzlyProgramming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and GrizzlyC2B2 Consulting
 
Large Scale Deployment of SOA-P
Large Scale Deployment of SOA-PLarge Scale Deployment of SOA-P
Large Scale Deployment of SOA-PC2B2 Consulting
 
Real Life Java EE Performance Tuning
Real Life Java EE Performance TuningReal Life Java EE Performance Tuning
Real Life Java EE Performance TuningC2B2 Consulting
 
Tales From the Web Logic Front Line
Tales From the Web Logic Front LineTales From the Web Logic Front Line
Tales From the Web Logic Front LineC2B2 Consulting
 

Viewers also liked (20)

Davoxx 2012 - 'JMS 2.0 Update'
Davoxx 2012 - 'JMS 2.0 Update'Davoxx 2012 - 'JMS 2.0 Update'
Davoxx 2012 - 'JMS 2.0 Update'
 
JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning
JudCon 2010 Berlin: Practical Enterprise Java Performance TuningJudCon 2010 Berlin: Practical Enterprise Java Performance Tuning
JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
 
Novo apendice ii_do_anexo_i_2013-11-14_10_15_08
Novo apendice ii_do_anexo_i_2013-11-14_10_15_08Novo apendice ii_do_anexo_i_2013-11-14_10_15_08
Novo apendice ii_do_anexo_i_2013-11-14_10_15_08
 
Resenha espirita on line 99
Resenha espirita on line 99Resenha espirita on line 99
Resenha espirita on line 99
 
GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy
 
London JBUG – We’re back!
London JBUG – We’re back!London JBUG – We’re back!
London JBUG – We’re back!
 
Data Grids JSRs
Data Grids JSRsData Grids JSRs
Data Grids JSRs
 
JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge
JUDCon London 2011 - Elastic SOA on the Cloud, Steve MillidgeJUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge
JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge
 
Coherence For Extreme Performance, Availablity and Scalability
Coherence For Extreme Performance, Availablity and ScalabilityCoherence For Extreme Performance, Availablity and Scalability
Coherence For Extreme Performance, Availablity and Scalability
 
Infinispan from POC to Production
Infinispan from POC to ProductionInfinispan from POC to Production
Infinispan from POC to Production
 
Large Scale Migration from WebLogic to JBoss
Large Scale Migration from WebLogic to JBossLarge Scale Migration from WebLogic to JBoss
Large Scale Migration from WebLogic to JBoss
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
 
Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...
Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...
Data Grids for Extreme Performance, Scalability and Availability JavaOne 2011...
 
Portlets 2.0 JSR286
Portlets 2.0 JSR286Portlets 2.0 JSR286
Portlets 2.0 JSR286
 
Monitoring and Tuning GlassFish
Monitoring and Tuning GlassFishMonitoring and Tuning GlassFish
Monitoring and Tuning GlassFish
 
Programming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and GrizzlyProgramming WebSockets with Glassfish and Grizzly
Programming WebSockets with Glassfish and Grizzly
 
Large Scale Deployment of SOA-P
Large Scale Deployment of SOA-PLarge Scale Deployment of SOA-P
Large Scale Deployment of SOA-P
 
Real Life Java EE Performance Tuning
Real Life Java EE Performance TuningReal Life Java EE Performance Tuning
Real Life Java EE Performance Tuning
 
Tales From the Web Logic Front Line
Tales From the Web Logic Front LineTales From the Web Logic Front Line
Tales From the Web Logic Front Line
 

Similar to Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the Memory

CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013Andrew Khoury
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaoladrewz lin
 
Tips for better CI on Android
Tips for better CI on AndroidTips for better CI on Android
Tips for better CI on AndroidTomoaki Imai
 
Manipulating Memory for Fun and Profit
Manipulating Memory for Fun and ProfitManipulating Memory for Fun and Profit
Manipulating Memory for Fun and ProfitJovi Umawing
 
Manipulating memory for fun and profit
Manipulating memory for fun and profitManipulating memory for fun and profit
Manipulating memory for fun and profitYury Chemerkin
 
Manipulating memory for fun and profit
Manipulating memory for fun and profitManipulating memory for fun and profit
Manipulating memory for fun and profitYury Chemerkin
 
A Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbert
A Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbertA Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbert
A Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbertJ On The Beach
 
Rust Programming Language
Rust Programming LanguageRust Programming Language
Rust Programming LanguageJaeju Kim
 
Android secure offline storage - CC Mobile
Android secure offline storage - CC MobileAndroid secure offline storage - CC Mobile
Android secure offline storage - CC MobileSteve De Zitter
 
Android secure offline storage - CC Mobile
Android secure offline storage - CC MobileAndroid secure offline storage - CC Mobile
Android secure offline storage - CC MobileJWORKS powered by Ordina
 
5 Apache Spark Tips in 5 Minutes
5 Apache Spark Tips in 5 Minutes5 Apache Spark Tips in 5 Minutes
5 Apache Spark Tips in 5 MinutesCloudera, Inc.
 
Data Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center ZurichData Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center ZurichRomeo Kienzler
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Peter Hlavaty
 
Advanced Administration, Monitoring and Backup
Advanced Administration, Monitoring and BackupAdvanced Administration, Monitoring and Backup
Advanced Administration, Monitoring and BackupMongoDB
 
Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOSJeremy Brown
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Yossi Elkrief
 
GlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 ConsultingGlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 Consultingglassfish
 

Similar to Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the Memory (20)

CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaola
 
Tips for better CI on Android
Tips for better CI on AndroidTips for better CI on Android
Tips for better CI on Android
 
Manipulating Memory for Fun and Profit
Manipulating Memory for Fun and ProfitManipulating Memory for Fun and Profit
Manipulating Memory for Fun and Profit
 
Manipulating memory for fun and profit
Manipulating memory for fun and profitManipulating memory for fun and profit
Manipulating memory for fun and profit
 
Manipulating Memory for Fun & Profit
Manipulating Memory for Fun & ProfitManipulating Memory for Fun & Profit
Manipulating Memory for Fun & Profit
 
Manipulating memory for fun and profit
Manipulating memory for fun and profitManipulating memory for fun and profit
Manipulating memory for fun and profit
 
A Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbert
A Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbertA Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbert
A Post-Apocalyptic sun.misc.Unsafe World by Christoph engelbert
 
Rust Programming Language
Rust Programming LanguageRust Programming Language
Rust Programming Language
 
Android secure offline storage - CC Mobile
Android secure offline storage - CC MobileAndroid secure offline storage - CC Mobile
Android secure offline storage - CC Mobile
 
Android secure offline storage - CC Mobile
Android secure offline storage - CC MobileAndroid secure offline storage - CC Mobile
Android secure offline storage - CC Mobile
 
Us 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimesUs 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimes
 
5 Apache Spark Tips in 5 Minutes
5 Apache Spark Tips in 5 Minutes5 Apache Spark Tips in 5 Minutes
5 Apache Spark Tips in 5 Minutes
 
Data Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center ZurichData Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
 
Advanced Administration, Monitoring and Backup
Advanced Administration, Monitoring and BackupAdvanced Administration, Monitoring and Backup
Advanced Administration, Monitoring and Backup
 
Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOS
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Android Memory , Where is all My RAM
Android Memory , Where is all My RAM
 
GlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 ConsultingGlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 Consulting
 

More from C2B2 Consulting

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015C2B2 Consulting
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandC2B2 Consulting
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteC2B2 Consulting
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid C2B2 Consulting
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLSTC2B2 Consulting
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceC2B2 Consulting
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!C2B2 Consulting
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShiftC2B2 Consulting
 
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleOracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleC2B2 Consulting
 
Java Middleware Surgery
Java Middleware Surgery Java Middleware Surgery
Java Middleware Surgery C2B2 Consulting
 
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...C2B2 Consulting
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' C2B2 Consulting
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel DeakinC2B2 Consulting
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webC2B2 Consulting
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleC2B2 Consulting
 
Monitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring InsightMonitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring InsightC2B2 Consulting
 
Middleware Expert Support Presentation
Middleware Expert Support PresentationMiddleware Expert Support Presentation
Middleware Expert Support PresentationC2B2 Consulting
 

More from C2B2 Consulting (20)

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA Suite
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performance
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShift
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
 
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleOracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
 
Java Middleware Surgery
Java Middleware Surgery Java Middleware Surgery
Java Middleware Surgery
 
Jax London 2013
Jax London 2013Jax London 2013
Jax London 2013
 
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker'
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
 
Monitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring InsightMonitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring Insight
 
Middleware Expert Support Presentation
Middleware Expert Support PresentationMiddleware Expert Support Presentation
Middleware Expert Support Presentation
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the Memory

  • 1. Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the Memory Heap @author Jaromir Hamala, jhamala@c2b2.co.uk @author(type=Twitter) @jerrinot © C2B2 Consulting Limited 2013 All Rights Reserved
  • 2. Who Am I? ■ Jaromir Hamala ■ A curious developer ■ Who likes to break play with stuff © C2B2 Consulting Limited 2013 All Rights Reserved
  • 3. Safe Harbor This talk may contain non-sense! © C2B2 Consulting Limited 2013 All Rights Reserved
  • 4. Facts • Memory is Cheap • We have a lot of data • Data in Memory == Fastest Possible Data (apart from CPU caches) http://www.npr.org/blogs/thetwo-way/2012/06/06/154416480/ho-hum-dull-and-boring-are-now-a-pair © C2B2 Consulting Limited 2013 All Rights Reserved
  • 5. On-Heap Allocation • CoolObject cool = new CoolObject() • Great: – It’s easy and usually *very* fast! • Allocation can be actually faster than in C – GC goodies! • Not so great: – GC leads to Stop-the-World Pauses – Bigger Heap -> Longer Pauses © C2B2 Consulting Limited 2013 All Rights Reserved
  • 6. © C2B2 Consulting Limited 2013 All Rights Reserved
  • 7. © C2B2 Consulting Limited 2013 All Rights Reserved
  • 8. Why to go Off-Heap? • Latency caused by GC • Locality • Sharing with non-Java http://digboston.com/boston-lulz/2013/08/trolley-trollop-first-comes-love/attachment/why-god-why-kitten1/ © C2B2 Consulting Limited 2013 All Rights Reserved
  • 9. GC Implementations • (Old Gen) GC in HotSpot (Oracle/Sun JDK, OpenJDK) – ParOld – STW pauses by design! – CMS – fragmentation -> STW pause – G1 – Immature (yet?), not fulfilling the expectations -> occasional STW pauses © C2B2 Consulting Limited 2013 All Rights Reserved
  • 10. Latency can kill you! © C2B2 Consulting Limited 2013 All Rights Reserved
  • 11. What is Off-Heap? • Area of memory not maintained by GC – Manual memory control • No Notion of Java object – serialization http://nickshell1983.wordpress.com/2010/06/29/taking-a-god-nudged-leap-of-faith/ © C2B2 Consulting Limited 2013 All Rights Reserved
  • 12. Off-Heap Options? • • • • • Direct Memory Buffer sun.misc.Unsafe JNI Memory Mapped File …. http://en.wikipedia.org/wiki/File:Road_to_Hell_One_Sheet.jpg © C2B2 Consulting Limited 2013 All Rights Reserved
  • 13. Direct Memory Buffer • ByteBuffer directBuf = ByteBuffer.allocateDirect(int noBytes); • • • • Part of Java NIO Max. 2GB / buffer Pure Java = Portable getX()/putX() methods © C2B2 Consulting Limited 2013 All Rights Reserved
  • 14. sun.misc.Unsafe – long addr = unsafe.allocateMemory(noBytes) – Not a standardized part of JDK! – Implemented by most JVM vendors • Sun / Oracle / IBM – It can disappear from JDK without warning! © C2B2 Consulting Limited 2013 All Rights Reserved
  • 15. Cassandra I. public class NativeAllocator implements IAllocator { static final Unsafe unsafe; static { try { Field field = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); field.setAccessible(true); unsafe = (sun.misc.Unsafe) field.get(null); } catch (Exception e) { throw new AssertionError(e); } } public long allocate(long size) { return unsafe.allocateMemory(size); } public void free(long peer) { unsafe.freeMemory(peer); } } © C2B2 Consulting Limited 2013 All Rights Reserved
  • 16. JNI • Java Native Interface • Native library means worst portability between platforms • JNI Overhead • Can re-use already existing (native) allocator © C2B2 Consulting Limited 2013 All Rights Reserved
  • 17. Cassandra II. • Java Native Interface via JNA public class JEMallocAllocator implements IAllocator { public interface JEMLibrary extends Library { long malloc(long size); void free(long pointer); } private final JEMLibrary library; public JEMallocAllocator() { library = (JEMLibrary) Native.loadLibrary("jemalloc", JEMLibrary.class); } public long allocate(long size) { return library.malloc(size); } public void free(long peer) { library.free(peer); } } © C2B2 Consulting Limited 2013 All Rights Reserved
  • 18. Memory Mapped File • • • • Part of NIO Pure Java -> Portable Allows sharing data between processes Persisted by OS © C2B2 Consulting Limited 2013 All Rights Reserved
  • 19. Javin Paul, http://javarevisited.blogspot.com/2012/01/memorymapped-file-and-io-in-java.html private static int count = 1010241024; //10 MB public static void main(String[] args) throws Exception { RandomAccessFile memoryMappedFile = new RandomAccessFile("largeFile.txt", "rw"); //Mapping a file into memory MappedByteBuffer out = memoryMappedFile.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, count); //Writing into Memory Mapped File for (int i = 0; i < count; i++) { out.put((byte) 'A'); } System.out.println("Writing to Memory Mapped File is completed"); //reading from memory file in Java for (int i = 0; i < 10 ; i++) { System.out.print((char) out.get(i)); } System.out.println("Reading from Memory Mapped File is completed"); } © C2B2 Consulting Limited 2013 All Rights Reserved
  • 20. Use cases for Off-Heap? • Caches / Data Grids – A lot of data – Objects with well defined lifecycle • (Extremely) Latency-Sensitive tasks – High-Frequency trading… • Sharing Data with non-Java © C2B2 Consulting Limited 2013 All Rights Reserved
  • 21. Apache DirectMemory • “…is a off-heap cache for the Java Virtual Machine” • Easy to integrate • Friendly License • Experimental • http://directmemory.apache.org/ © C2B2 Consulting Limited 2013 All Rights Reserved
  • 22. DirectMemory Usage CacheService<Object, Object> cacheService = new DirectMemory<Object, Object>() .setNumberOfBuffers( 10 ) .setSize( 1000 ) .setInitialCapacity( 100000 ) .setConcurrencyLevel( 4 ) .newCacheService(); put( K key, V value ) put( K key, V value, int expiresIn ) © C2B2 Consulting Limited 2013 All Rights Reserved
  • 23. Is Off-Heap The Future of Java? • Oh God! Please no! • R&D should be aimed to more effective GC – Zing JVM (based on HotSpot, C4 - the fully concurrent GC) – RedHat Shenandoah? © C2B2 Consulting Limited 2013 All Rights Reserved
  • 24. Final Warning(s) • Stay On-Heap unless you have no other choice! • If you think you have no other choice, think twice • Do NOT re-invent the wheel! (Memory Management) • Measure, measure, measure! © C2B2 Consulting Limited 2013 All Rights Reserved
  • 25. Further Sources • http://mechanical-sympathy.blogspot.com/ – Martin Thompson. There is a brilliant mailing list as well! • http://psy-lob-saw.blogspot.com – Nitsan Wakart • http://vanillajava.blogspot.com – Peter Lawrey • http://insightfullogic.com/blog/ – Richard Warburton • http://ashkrit.blogspot.com – Ashkrit © C2B2 Consulting Limited 2013 All Rights Reserved
  • 26. © C2B2 Consulting Limited 2013 All Rights Reserved
  • 27. Thank you © C2B2 Consulting Limited 2013 All Rights Reserved