SlideShare ist ein Scribd-Unternehmen logo
1 von 51
©2015 GlobalLogic Inc.
2
Java Memory Management
Tricks
By Andrii Antilikatorov
3
4
5
Agenda
6
When we start to think about memory-related things?
7
Battle of Garbage Collectors
Serial Parallel CMS G1
8
Battle of Garbage Collectors
Do I really need to think about this?
9
Battle of Garbage Collectors
10
Serial GC
Runs great on low-end computers
Long pauses during garbage collections
Recommended for single-core CPU and
heaps under 100Mb
…old, but not obsolete! ©
11
Serial GC
Min & Max heap size - Xms/Xmx
Free space ratio in each generation:
MinHeapFreeRatio=?, MaxHeapFreeRatio=?
Young/Old generations ratio: NewRatio=?
Young generation min/max size: NewSize=?, MaxNewSize=?
Eden/Survivor ratio: SurvivorRatio=?
Set GC activity limit: UseGCOverheadLimit
12
Parallel GC
Supports automatic self-tuning for optimal performance
Memory fragmentation
Perfectly consumes multi-core CPU power
13
Parallel GC
Supports automatic self-tuning for optimal performance
Memory fragmentation
Perfectly consumes multi-core CPU power
All options of Serial GC are applicable
Number of GC threads: ParallelGCThreads=?
Disable compaction in Old Gen: UseParallelOldGC
Performance options: MaxGCPauseMillis=?, GCTimeRatio=?
Generation size increment: YoungGenerationSizeIncrement,
TenuredGenerationSizeIncrement
Generation size decrease: AdaptiveSizeDecrementScaleFactor
14
Concurrent Mark-Sweep GC
Works as Parallel GC in case of minor GC
Minimizes pauses, but sacrifices CPU and throughput
Consumes more memory (+20%)
Long pauses in case of concurrency mode failures
Works great with big data with long-living objects
15
Concurrent Mark-Sweep GC
Works as Parallel GC in case of minor GC
All options of Serial and Parallel GC are applicable
Major GC threshold:
CMSInitiatingOccupancyFraction=?
16
Garbage First (G1) GC
JEP 248: Make G1 the Default Garbage Collector on 32- and
64-bit server configurations starting from Java 9
Designed for systems where limiting latency is more
important than maximizing throughput
More accurate pause prediction
No memory fragmentation
High CPU utilization
17
Garbage First (G1) GC
JEP 248: Make G1 the Default Garbage Collector on 32- and
64-bit server configurations starting from Java 9
Designed for systems where limiting latency is more
important than maximizing throughput
More accurate pause prediction
No memory fragmentation
High CPU utilization
Number of GC threads and Marking threads:
ParallelGCThreads=?, ConcGCThreads=?
Heap region size: G1HeapRegionSize=?
Pause minimization: MaxGCPauseMillis=?
Heap memory allocation threshold:
InitiatingHeapOccupancyPercent=?
Options for real geeks: UnlockExperimentalVMOptions,
AggressiveOpts
18
Memory Access
Heap
Direct Memory Access
(Off-Heap)
Non-Direct ByteBuffer
Direct ByteBuffer
19
Memory Access
Heap
Direct Memory Access
(Off-Heap)
Non-Direct ByteBuffer
X Axis – No Of Reading
Y Axis – Op/Second in Millions
Direct ByteBuffer
20
Memory Access
Heap
Direct Memory Access
(Off-Heap)
Non-Direct ByteBuffer
X Axis – No Of Reading
Y Axis – Op/Second in Millions
Direct ByteBuffer
21
Memory Access
Heap
Direct Memory Access
(Off-Heap)
Non-Direct ByteBuffer
X Axis – No Of Reading
Y Axis – Op/Second in Millions
Direct ByteBuffer
22
Memory Access
Heap
Direct Memory Access
(Off-Heap)
Non-Direct ByteBuffer
X Axis – No Of Reading
Y Axis – Op/Second in Millions
Direct ByteBuffer
23
Direct Memory Alignment in Java
Type alignment Page size alignment
Cache line alignment
Memory Alignment
24
Direct Memory Alignment in Java
Type alignment Page size alignment
Cache line alignment
Memory Alignment“= new SomeObj()” always type-aligned.
“Unsafe.allocateMemory” always 8-bytes aligned.
“ByteBuffer.allocateDirect” …
Memory is 0-ed out automatically
Memory is page-aligned in JDK ≤ 1.6 and ‘8-bytes’ aligned in JDK ≥ 1.7
Memory is is freed as part of the ByteBuffer object GC
25
Comparing Aligned/Unaligned Access Performance
Type aligned access provides better performance than
unaligned access.
Memory access that spans 2 cache lines has far worse
performance than aligned mid-cache line access.
Cache line access performance changes based on
cache line location.
26
Comparing Aligned/Unaligned Access Performance
Type aligned access provides better performance than
unaligned access.
Memory access that spans 2 cache lines has far worse
performance than aligned mid-cache line access.
Cache line access performance changes based on
cache line location.
27
Type-aligned vs unaligned Access Test
Number of pages
Alignment
Relative cost
28
Comparing Aligned/Unaligned Access Performance
Type aligned access provides better performance than
unaligned access.
Memory access that spans 2 cache lines has far worse
performance than aligned mid-cache line access.
Cache line access performance changes based on
cache line location.
29
Cross-line cache access
Number of pages
Offset
Relative cost
30
Comparing Aligned/Unaligned Access Performance
Type aligned access provides better performance than
unaligned access.
Memory access that spans 2 cache lines has far worse
performance than aligned mid-cache line access.
Cache line access performance changes based on
cache line location.
31
Comparing Aligned/Unaligned Access Performance
Type aligned access provides better performance than
unaligned access.
Memory access that spans 2 cache lines has far worse
performance than aligned mid-cache line access.
Cache line access performance changes based on
cache line location.
32
Cost of Access Based on Cache Line Location
Offset
Number of pagesRelative cost
33
Comparing Aligned/Unaligned Access Performance
Type aligned access provides better performance than
unaligned access.
Memory access that spans 2 cache lines has far worse
performance than aligned mid-cache line access.
Cache line access performance changes based on
cache line location.
34
sun.misc.Unsafe
Direct Object
Manipulations
Class Structure
Manipulations
Arrays
Manipulations
Synchronization
Primitives
Low-level
Memory Access
Low-level
Memory Info
sun.misc.Unsafe
35
sun.misc.Unsafe – Obtain Unobtainable
Unsafe unsafe = Unsafe.getUnsafe();
36
sun.misc.Unsafe – Obtain Unobtainable
Unsafe unsafe = Unsafe.getUnsafe();
37
sun.misc.Unsafe – Obtain Unobtainable
38
Create an Instance Without Calling a Constructor
Need a “hack” to create new instance of Singleton
Need to avoid execution of heavy constructor logic
Custom serialization/deserialization.
39
Create an Instance Without Calling a Constructor
40
Create an Instance Without Calling a Constructor
41
Create an Instance Without Calling a Constructor
50
50
0
42
Measure Shallow Size of an Object
Sizes of data structures are fixed for 32/64bit platforms
According to ‘sizeof’ is not required because…
Java VM’s GC does complete memory management
…and you still can ‘measure’ the object by serializing
to byte stream and looking at its length…
43
Measure Shallow Size of an Object
Looking through all
non-static fields
Calculating offset of
the last field
Taking into account
memory alignment
44
Measure Shallow Size of an Object
Getting data from
class struct
Converting signed
integer to long
Taking into account
header size
45
Low-Level Memory Allocation
…for those who need extremely large arrays
46
Low-Level Memory Allocation
Element size
Direct memory
allocation
Get/Put elements
to array
47
How About a Kind of Multiple Inheritance?
No multiple inheritance
Really?
48
How About a Kind of Multiple Inheritance?
49
How About a Kind of Multiple Inheritance?
50
©2015 GlobalLogic Inc.

Weitere ähnliche Inhalte

Was ist angesagt?

MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016Wagner Bianchi
 
MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !Frederic Descamps
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기NeoClova
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestratorYoungHeon (Roy) Kim
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationSveta Smirnova
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
Introduction to Greenplum
Introduction to GreenplumIntroduction to Greenplum
Introduction to GreenplumDave Cramer
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Amazon Web Services
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceMariaDB plc
 
Using ZFS file system with MySQL
Using ZFS file system with MySQLUsing ZFS file system with MySQL
Using ZFS file system with MySQLMydbops
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBMydbops
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleMariaDB plc
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An IntroductionSmita Prasad
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼NeoClova
 
Understanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersUnderstanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersCarlos Sierra
 
Parallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQLParallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQLMydbops
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxNeoClova
 

Was ist angesagt? (20)

MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
 
MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestrator
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Introduction to Greenplum
Introduction to GreenplumIntroduction to Greenplum
Introduction to Greenplum
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools short
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performance
 
Using ZFS file system with MySQL
Using ZFS file system with MySQLUsing ZFS file system with MySQL
Using ZFS file system with MySQL
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
Understanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersUnderstanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginners
 
InnoDB Locking Explained with Stick Figures
InnoDB Locking Explained with Stick FiguresInnoDB Locking Explained with Stick Figures
InnoDB Locking Explained with Stick Figures
 
Parallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQLParallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQL
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
 

Ähnlich wie Java Memory Management Tricks

Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Anna Shymchenko
 
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...Mshari Alabdulkarim
 
Mastering java in containers - MadridJUG
Mastering java in containers - MadridJUGMastering java in containers - MadridJUG
Mastering java in containers - MadridJUGJorge Morales
 
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...HostedbyConfluent
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020Jelastic Multi-Cloud PaaS
 
Deep Dive on Delivering Amazon EC2 Instance Performance
Deep Dive on Delivering Amazon EC2 Instance PerformanceDeep Dive on Delivering Amazon EC2 Instance Performance
Deep Dive on Delivering Amazon EC2 Instance PerformanceAmazon Web Services
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageJelastic Multi-Cloud PaaS
 
Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey J On The Beach
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvmPrem Kuppumani
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsIsuru Perera
 
Resource Scheduling using Apache Mesos in Cloud Native Environments
Resource Scheduling using Apache Mesos in Cloud Native EnvironmentsResource Scheduling using Apache Mesos in Cloud Native Environments
Resource Scheduling using Apache Mesos in Cloud Native EnvironmentsSharma Podila
 
Exploiting rateless codes in cloud storage systems
Exploiting rateless codes in cloud storage systemsExploiting rateless codes in cloud storage systems
Exploiting rateless codes in cloud storage systemsieeepondy
 
Jug Lugano - Scale over the limits
Jug Lugano - Scale over the limitsJug Lugano - Scale over the limits
Jug Lugano - Scale over the limitsDavide Carnevali
 
Responding rapidly when you have 100+ GB data sets in Java
Responding rapidly when you have 100+ GB data sets in JavaResponding rapidly when you have 100+ GB data sets in Java
Responding rapidly when you have 100+ GB data sets in JavaPeter Lawrey
 

Ähnlich wie Java Memory Management Tricks (20)

Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
 
.NET Performance Boost
.NET Performance Boost.NET Performance Boost
.NET Performance Boost
 
JVM Magic
JVM MagicJVM Magic
JVM Magic
 
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
 
Mastering java in containers - MadridJUG
Mastering java in containers - MadridJUGMastering java in containers - MadridJUG
Mastering java in containers - MadridJUG
 
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
 
Deep Dive on Delivering Amazon EC2 Instance Performance
Deep Dive on Delivering Amazon EC2 Instance PerformanceDeep Dive on Delivering Amazon EC2 Instance Performance
Deep Dive on Delivering Amazon EC2 Instance Performance
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
 
Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in Java
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
 
Resource Scheduling using Apache Mesos in Cloud Native Environments
Resource Scheduling using Apache Mesos in Cloud Native EnvironmentsResource Scheduling using Apache Mesos in Cloud Native Environments
Resource Scheduling using Apache Mesos in Cloud Native Environments
 
Exploiting rateless codes in cloud storage systems
Exploiting rateless codes in cloud storage systemsExploiting rateless codes in cloud storage systems
Exploiting rateless codes in cloud storage systems
 
Java under the hood
Java under the hoodJava under the hood
Java under the hood
 
The Google file system
The Google file systemThe Google file system
The Google file system
 
Jug Lugano - Scale over the limits
Jug Lugano - Scale over the limitsJug Lugano - Scale over the limits
Jug Lugano - Scale over the limits
 
Responding rapidly when you have 100+ GB data sets in Java
Responding rapidly when you have 100+ GB data sets in JavaResponding rapidly when you have 100+ GB data sets in Java
Responding rapidly when you have 100+ GB data sets in Java
 

Mehr von GlobalLogic Ukraine

GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”GlobalLogic Ukraine
 
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic Ukraine
 
Штучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxGlobalLogic Ukraine
 
Задачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxGlobalLogic Ukraine
 
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxGlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Ukraine
 
JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"GlobalLogic Ukraine
 
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic Ukraine
 
Страх і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic EducationСтрах і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic EducationGlobalLogic Ukraine
 
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic Ukraine
 
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic Ukraine
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?GlobalLogic Ukraine
 
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Ukraine
 
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Ukraine
 
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic Ukraine
 
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"GlobalLogic Ukraine
 
GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"GlobalLogic Ukraine
 
C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"GlobalLogic Ukraine
 
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...GlobalLogic Ukraine
 

Mehr von GlobalLogic Ukraine (20)

GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
 
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
 
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
 
Штучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptx
 
Задачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptx
 
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
 
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
 
JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"
 
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
 
Страх і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic EducationСтрах і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic Education
 
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
 
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
 
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
 
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
 
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
 
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
 
GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"
 
C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"
 
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
 

Kürzlich hochgeladen

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 

Kürzlich hochgeladen (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Java Memory Management Tricks

  • 2. 2 Java Memory Management Tricks By Andrii Antilikatorov
  • 3. 3
  • 4. 4
  • 6. 6 When we start to think about memory-related things?
  • 7. 7 Battle of Garbage Collectors Serial Parallel CMS G1
  • 8. 8 Battle of Garbage Collectors Do I really need to think about this?
  • 9. 9 Battle of Garbage Collectors
  • 10. 10 Serial GC Runs great on low-end computers Long pauses during garbage collections Recommended for single-core CPU and heaps under 100Mb …old, but not obsolete! ©
  • 11. 11 Serial GC Min & Max heap size - Xms/Xmx Free space ratio in each generation: MinHeapFreeRatio=?, MaxHeapFreeRatio=? Young/Old generations ratio: NewRatio=? Young generation min/max size: NewSize=?, MaxNewSize=? Eden/Survivor ratio: SurvivorRatio=? Set GC activity limit: UseGCOverheadLimit
  • 12. 12 Parallel GC Supports automatic self-tuning for optimal performance Memory fragmentation Perfectly consumes multi-core CPU power
  • 13. 13 Parallel GC Supports automatic self-tuning for optimal performance Memory fragmentation Perfectly consumes multi-core CPU power All options of Serial GC are applicable Number of GC threads: ParallelGCThreads=? Disable compaction in Old Gen: UseParallelOldGC Performance options: MaxGCPauseMillis=?, GCTimeRatio=? Generation size increment: YoungGenerationSizeIncrement, TenuredGenerationSizeIncrement Generation size decrease: AdaptiveSizeDecrementScaleFactor
  • 14. 14 Concurrent Mark-Sweep GC Works as Parallel GC in case of minor GC Minimizes pauses, but sacrifices CPU and throughput Consumes more memory (+20%) Long pauses in case of concurrency mode failures Works great with big data with long-living objects
  • 15. 15 Concurrent Mark-Sweep GC Works as Parallel GC in case of minor GC All options of Serial and Parallel GC are applicable Major GC threshold: CMSInitiatingOccupancyFraction=?
  • 16. 16 Garbage First (G1) GC JEP 248: Make G1 the Default Garbage Collector on 32- and 64-bit server configurations starting from Java 9 Designed for systems where limiting latency is more important than maximizing throughput More accurate pause prediction No memory fragmentation High CPU utilization
  • 17. 17 Garbage First (G1) GC JEP 248: Make G1 the Default Garbage Collector on 32- and 64-bit server configurations starting from Java 9 Designed for systems where limiting latency is more important than maximizing throughput More accurate pause prediction No memory fragmentation High CPU utilization Number of GC threads and Marking threads: ParallelGCThreads=?, ConcGCThreads=? Heap region size: G1HeapRegionSize=? Pause minimization: MaxGCPauseMillis=? Heap memory allocation threshold: InitiatingHeapOccupancyPercent=? Options for real geeks: UnlockExperimentalVMOptions, AggressiveOpts
  • 18. 18 Memory Access Heap Direct Memory Access (Off-Heap) Non-Direct ByteBuffer Direct ByteBuffer
  • 19. 19 Memory Access Heap Direct Memory Access (Off-Heap) Non-Direct ByteBuffer X Axis – No Of Reading Y Axis – Op/Second in Millions Direct ByteBuffer
  • 20. 20 Memory Access Heap Direct Memory Access (Off-Heap) Non-Direct ByteBuffer X Axis – No Of Reading Y Axis – Op/Second in Millions Direct ByteBuffer
  • 21. 21 Memory Access Heap Direct Memory Access (Off-Heap) Non-Direct ByteBuffer X Axis – No Of Reading Y Axis – Op/Second in Millions Direct ByteBuffer
  • 22. 22 Memory Access Heap Direct Memory Access (Off-Heap) Non-Direct ByteBuffer X Axis – No Of Reading Y Axis – Op/Second in Millions Direct ByteBuffer
  • 23. 23 Direct Memory Alignment in Java Type alignment Page size alignment Cache line alignment Memory Alignment
  • 24. 24 Direct Memory Alignment in Java Type alignment Page size alignment Cache line alignment Memory Alignment“= new SomeObj()” always type-aligned. “Unsafe.allocateMemory” always 8-bytes aligned. “ByteBuffer.allocateDirect” … Memory is 0-ed out automatically Memory is page-aligned in JDK ≤ 1.6 and ‘8-bytes’ aligned in JDK ≥ 1.7 Memory is is freed as part of the ByteBuffer object GC
  • 25. 25 Comparing Aligned/Unaligned Access Performance Type aligned access provides better performance than unaligned access. Memory access that spans 2 cache lines has far worse performance than aligned mid-cache line access. Cache line access performance changes based on cache line location.
  • 26. 26 Comparing Aligned/Unaligned Access Performance Type aligned access provides better performance than unaligned access. Memory access that spans 2 cache lines has far worse performance than aligned mid-cache line access. Cache line access performance changes based on cache line location.
  • 27. 27 Type-aligned vs unaligned Access Test Number of pages Alignment Relative cost
  • 28. 28 Comparing Aligned/Unaligned Access Performance Type aligned access provides better performance than unaligned access. Memory access that spans 2 cache lines has far worse performance than aligned mid-cache line access. Cache line access performance changes based on cache line location.
  • 29. 29 Cross-line cache access Number of pages Offset Relative cost
  • 30. 30 Comparing Aligned/Unaligned Access Performance Type aligned access provides better performance than unaligned access. Memory access that spans 2 cache lines has far worse performance than aligned mid-cache line access. Cache line access performance changes based on cache line location.
  • 31. 31 Comparing Aligned/Unaligned Access Performance Type aligned access provides better performance than unaligned access. Memory access that spans 2 cache lines has far worse performance than aligned mid-cache line access. Cache line access performance changes based on cache line location.
  • 32. 32 Cost of Access Based on Cache Line Location Offset Number of pagesRelative cost
  • 33. 33 Comparing Aligned/Unaligned Access Performance Type aligned access provides better performance than unaligned access. Memory access that spans 2 cache lines has far worse performance than aligned mid-cache line access. Cache line access performance changes based on cache line location.
  • 35. 35 sun.misc.Unsafe – Obtain Unobtainable Unsafe unsafe = Unsafe.getUnsafe();
  • 36. 36 sun.misc.Unsafe – Obtain Unobtainable Unsafe unsafe = Unsafe.getUnsafe();
  • 38. 38 Create an Instance Without Calling a Constructor Need a “hack” to create new instance of Singleton Need to avoid execution of heavy constructor logic Custom serialization/deserialization.
  • 39. 39 Create an Instance Without Calling a Constructor
  • 40. 40 Create an Instance Without Calling a Constructor
  • 41. 41 Create an Instance Without Calling a Constructor 50 50 0
  • 42. 42 Measure Shallow Size of an Object Sizes of data structures are fixed for 32/64bit platforms According to ‘sizeof’ is not required because… Java VM’s GC does complete memory management …and you still can ‘measure’ the object by serializing to byte stream and looking at its length…
  • 43. 43 Measure Shallow Size of an Object Looking through all non-static fields Calculating offset of the last field Taking into account memory alignment
  • 44. 44 Measure Shallow Size of an Object Getting data from class struct Converting signed integer to long Taking into account header size
  • 45. 45 Low-Level Memory Allocation …for those who need extremely large arrays
  • 46. 46 Low-Level Memory Allocation Element size Direct memory allocation Get/Put elements to array
  • 47. 47 How About a Kind of Multiple Inheritance? No multiple inheritance Really?
  • 48. 48 How About a Kind of Multiple Inheritance?
  • 49. 49 How About a Kind of Multiple Inheritance?
  • 50. 50