SlideShare a Scribd company logo
Java	Behind	The	Scenes	
	
	
	Igor	Dmitriev	#LTS	Logeek	Night,	Kyiv 					 	 	 	 	 								2016
Igor	Dmitriev	
							ihor.dmitriiev@gmail.com	
							ihor_dmitriiev	
							ihor_dmitriiev	
			igor-dmitriev-3a29b15a
Igor Dmitriev: "Java behind the scenes"
Igor Dmitriev: "Java behind the scenes"
Igor Dmitriev: "Java behind the scenes"
Igor Dmitriev: "Java behind the scenes"
Empty	ArrayList	is	iniIalized	with	
Object	array	of	size	10:	
Object[]	elementData	=	new	Object[10];
Igor Dmitriev: "Java behind the scenes"
Igor Dmitriev: "Java behind the scenes"
Delombok
Nathan	Reynolds	
Is	an	Architect	at		
and	works	in	PSR(Performance,	
Scalability	and	Reliability),		
team	dedicated	towards		
opImizing	Oracle	Middleware	
soVware.	He	is	the	Exalogic		
Performance	Architect.			
In	 this	 role,	 he	 oversees	 the	 technical	 aspects	 of	 analyzing	
profiles,	 figuring	 out	 opImizaIons,	 opImizing	 code	 and	
measuring	performance	impact.
Analysed	670	Java	heap	dumps	from	different	
Java	programs	to	find	out	memory	hogs.	
Most	popular	objects:	String,	char[],	Object[],	
ArrayList,	HashMap	
	
Heap	usage	per	collecIon:	20.1%	
-  Unused	collecIons	
-  Small	collecIons,	4	or	fewer	elements	(most	
significant	problem)	
-  Sparse	collecIons,	capacity	is	2	Imes	or	more	
than	what	you	need
jdk	1.7.0_40			ArrayList
Igor Dmitriev: "Java behind the scenes"
jdk	1.7.0_40			HashMap
jdk	1.8.0_25			HashMap
jdk	1.8.0_b132			HashMap	
	 	 	 	 					hash	collision
Igor Dmitriev: "Java behind the scenes"
-		Node<K,V>[]	table[10]	
-  table.length	=	64	
-  O(n)	
-  Client(number)
Igor Dmitriev: "Java behind the scenes"
-  Node<K,V>[]	table[10]	
-  table.length	=	64	
-  O(logn)														
-  Client(number)
Igor Dmitriev: "Java behind the scenes"
Non-comparable	Client
HashMap	
When?
How?	
Comparable	
Comparable	is	used
Non-comparable	
If	key	classes	are	equal	–	idenItyHashCode,		
otherwise	-	className.compareTo
Why	do	we	get	a	tree	when	we	add	11	element?
ConcurrentHashMap	
	jdk	1.7.0_40		
-  concurrencyLevel	(default	16)	
-  Segment	
-  Retrieval	operaIons	are	non-blocking	
-  Fail-safe	iterator	
-  sun.misc.Unsafe	is	used	for	concurrency	
operaIons
Igor Dmitriev: "Java behind the scenes"
jdk	1.8.0_25	
			Changes	
-  No	longer	has	segments	-	linked	array	
-  Balanced	tree	instead	of	linked	list	for	huge	
collisions
Igor Dmitriev: "Java behind the scenes"
Igor Dmitriev: "Java behind the scenes"
Useful	references	
Java	Memory	Hogs	hjps://www.youtube.com/watch?v=gz4LFnOstes	
	
Java	Language	and	Plamorm	Futures:	A	Sneak	Peek	by	Brian	Goetz	
hjps://www.youtube.com/watch?v=oGll155-vuQ	
	
Алексей	Шипилёв	—	О	чём	молчат	Heap	Dump-ы	
hjps://www.youtube.com/watch?v=r_bnfv-nlcs	
	
Алексей	Шипилёв	—	Катехизис	java.lang.String	
hjps://www.youtube.com/watch?v=SZFe3m1DV1A	
	
JDK	Release	Notes		
hjp://www.oracle.com/technetwork/java/javase/jdk-relnotes-
index-2162236.html
Igor Dmitriev: "Java behind the scenes"

More Related Content

PDF
Scala Days NYC 2016
PDF
Statistical Learning and Text Classification with NLTK and scikit-learn
PPTX
Big Data Science with H2O in R
PDF
Slick 3.0 functional programming and db side effects
PDF
Why Scala Is Taking Over the Big Data World
PDF
Deploying Machine Learning Models to Production
PPTX
Smart Data Conference: DL4J and DataVec
PPTX
Sergii Tsypanov: "Tricky enterprise"
Scala Days NYC 2016
Statistical Learning and Text Classification with NLTK and scikit-learn
Big Data Science with H2O in R
Slick 3.0 functional programming and db side effects
Why Scala Is Taking Over the Big Data World
Deploying Machine Learning Models to Production
Smart Data Conference: DL4J and DataVec
Sergii Tsypanov: "Tricky enterprise"

Viewers also liked (10)

PPTX
Vadym Ruchka «GraphQL from UI perspective»
PPTX
Andrii Datsenko «Practical RxJS»
PDF
Andrii Gryshchenko: "An Overview of CQRS and Event Sourcing"
PDF
Sergii Puzankov «UI Regression Testing with "Gemini"»
PDF
Corporate Profile
PDF
¿Que es una agencia de viajes?
DOCX
La edad moderna y sus avances
DOCX
Resume - R1.Docx
PPTX
Game show case studies
PDF
13 a bricedevey
Vadym Ruchka «GraphQL from UI perspective»
Andrii Datsenko «Practical RxJS»
Andrii Gryshchenko: "An Overview of CQRS and Event Sourcing"
Sergii Puzankov «UI Regression Testing with "Gemini"»
Corporate Profile
¿Que es una agencia de viajes?
La edad moderna y sus avances
Resume - R1.Docx
Game show case studies
13 a bricedevey
Ad

Similar to Igor Dmitriev: "Java behind the scenes" (20)

PDF
Martin Odersky: What's next for Scala
PDF
Scala and jvm_languages_praveen_technologist
PDF
Java 8 Lambda
PDF
Metaprogramming JavaScript
PDF
MySQL Document Store - A Document Store with all the benefts of a Transactona...
PDF
Oracle adapters for Ruby ORMs
PPT
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
PDF
[Wroclaw #7] Why So Serial?
PDF
Connecting the Worlds of Java and Ruby with JRuby
PPT
Data science and OSS
PDF
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
PDF
Scala js (kyiv js 30-01)
PDF
Bhavesh ro r
PDF
Terence Barr - jdk7+8 - 24mai2011
PPT
Ruby on rails
PDF
Ruby on Rails For .Net Programmers
PDF
Rafael Bagmanov «Scala in a wild enterprise»
PDF
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
PPTX
Scala Italy 2015 - Hands On ScalaJS
PPTX
Alberto Paro - Hands on Scala.js
Martin Odersky: What's next for Scala
Scala and jvm_languages_praveen_technologist
Java 8 Lambda
Metaprogramming JavaScript
MySQL Document Store - A Document Store with all the benefts of a Transactona...
Oracle adapters for Ruby ORMs
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
[Wroclaw #7] Why So Serial?
Connecting the Worlds of Java and Ruby with JRuby
Data science and OSS
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
Scala js (kyiv js 30-01)
Bhavesh ro r
Terence Barr - jdk7+8 - 24mai2011
Ruby on rails
Ruby on Rails For .Net Programmers
Rafael Bagmanov «Scala in a wild enterprise»
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Scala Italy 2015 - Hands On ScalaJS
Alberto Paro - Hands on Scala.js
Ad

More from LogeekNightUkraine (20)

PPTX
Face recognition with c++
PPTX
C++20 features
PPTX
Autonomous driving on your developer pc. technologies, approaches, future
PDF
Orkhan Gasimov "High Performance System Design"
PPTX
Vitalii Korzh "Managed Workflows or How to Master Data"
PDF
Yevhen Tatarynov "From POC to High-Performance .NET applications"
PDF
Oleksii Kuchuk "Reading gauge values with open cv imgproc"
PDF
Oleksandr Kutsan "Using katai struct to describe the process of working with ...
PDF
Pavlo Zhdanov "Mastering solid and base principles for software design"
PDF
Serhii Zemlianyi "Error Retries with Exponential Backoff Using RabbitMQ"
PDF
Iurii Antykhovych "Java and performance tools and toys"
PDF
Eugene Bova "Dapr (Distributed Application Runtime) in a Microservices Archit...
PPTX
Aleksandr Kutsan "Managing Dependencies in C++"
PDF
Yevhen Tatarynov "My .NET Application Allocates too Much Memory. What Can I Do?"
PDF
Alexandr Golyak, Nikolay Chertkov "Automotive Testing vs Test Automatio"
PPTX
Michal Kordas "Docker: Good, Bad or Both"
PPTX
Kolomiyets Dmytro "Dealing with Multiple Caches, When Developing Microservices"
PPTX
Shestakov Illia "The Sandbox Theory"
PPTX
Dmytro Kochergin “Autotest with CYPRESS”
PPTX
Ivan Dryzhyruk “Ducks Don’t Like Bugs”
Face recognition with c++
C++20 features
Autonomous driving on your developer pc. technologies, approaches, future
Orkhan Gasimov "High Performance System Design"
Vitalii Korzh "Managed Workflows or How to Master Data"
Yevhen Tatarynov "From POC to High-Performance .NET applications"
Oleksii Kuchuk "Reading gauge values with open cv imgproc"
Oleksandr Kutsan "Using katai struct to describe the process of working with ...
Pavlo Zhdanov "Mastering solid and base principles for software design"
Serhii Zemlianyi "Error Retries with Exponential Backoff Using RabbitMQ"
Iurii Antykhovych "Java and performance tools and toys"
Eugene Bova "Dapr (Distributed Application Runtime) in a Microservices Archit...
Aleksandr Kutsan "Managing Dependencies in C++"
Yevhen Tatarynov "My .NET Application Allocates too Much Memory. What Can I Do?"
Alexandr Golyak, Nikolay Chertkov "Automotive Testing vs Test Automatio"
Michal Kordas "Docker: Good, Bad or Both"
Kolomiyets Dmytro "Dealing with Multiple Caches, When Developing Microservices"
Shestakov Illia "The Sandbox Theory"
Dmytro Kochergin “Autotest with CYPRESS”
Ivan Dryzhyruk “Ducks Don’t Like Bugs”

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Cloud computing and distributed systems.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectral efficient network and resource selection model in 5G networks
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Machine Learning_overview_presentation.pptx
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectroscopy.pptx food analysis technology
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Cloud computing and distributed systems.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm

Igor Dmitriev: "Java behind the scenes"