SlideShare a Scribd company logo
How Java 19 Influences The
Future Of Your High-Scale
Applications
Java Champion Alumni, Certified Architect
Senior Developer Advocate
Passionate about solving complex scenarios involving Java and
Kubernetes.
@ammbra1508.mastodon.social
Any Change Starts with
Why
Why is Scalability Important?
Can cause service
disruptions that drive end users
away.
Impacts a business’s ability to
meet demands that
continuously change.
Reduces IT costs when demand
is less, and the system(s)
should downscale.
Types of Scalability
Vertical Scaling
Increase
RAM/CPU
Increase the number of machines
Horizontal Scaling
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Application Scalability
Matters
Application Scalability
An application's ability to handle a
growing number of users and load.
Not compromising on performance
or causing disruptions to user
experience when demand increases.
Measured by the number of requests
it can effectively support
simultaneously.
Scaling Through Elastic Adjustments
A combination of improvements to
network bandwidth, CPU and
memory requirements, and hard
disk adjustments.
Application needs to be correctly
configured, align the right software
protocols and hardware to meet
increasing number of requests per
seconds.
Write Once, Run Anywhere
A Partial History Of Running Anywhere
During the 1970s, computer science
focused on increasing the complexity of
computer architectures.
Semiconductor technology favoured a
type of computer architecture capable to
of complex instruction set computers
(CISCs).
From CISC to RISC
C. David Patterson and Carlo Sequin from
the University of California at Berkeley
thought that by simplifying the processor
a better performance can be achieved at a
much lower cost.
This hypothesis translated into RISC,
reduced instruction set computer.
Key Features of RISC-V
Simple
instruction set
Modularity Extensibility Open
Standard
Load-store
architecture
*At the moment, RISC-V still has limited hardware support.
The port will support the HotSpot subsystems
The template
interpreter
The C1 (client)
JIT compiler
The C2 (server)
JIT compiler
All current
mainline GCs,
including ZGC
and Shenandoah.
JEP 422 focuses on integration of the
Linux/RISC-V port into the JDK main-line
repository.
From ISA To SIMD
RISC-V is a free and open-
source RISC instruction set
architecture (ISA)
CPU architectures include
extensions to their instructions
sets that allow applying a
single instruction to multiple
data items simultaneously
(SIMD).
Heterogeneous ISAs offer
clock speed/parallelism
tradeoffs for workloads with
frequent usage of SIMD
instructions.
How Java 19 Influences the Future of Your High-Scale Applications .pdf
Portable Java ~ Efficient Java
Coding Style of Choice
Synchronous Asynchronous
Continuations
Scheduler
Thread
Platform Threads and Scaling
Platform threads take up
considerable memory to exist.
When you have lots of
blocking I/O, threads are just
waiting for data, and the CPU
is not utilized to its full
capacity.
Context switch for platform
threads is costly in terms of
resources.
Reactive Programming To The Rescue?!
Offers non-blocking I/O by letting a running thread
make a blocking call.
Analysing the performance and costs of reactive programming libraries in Java focuses on
RxJava, Project Reactor, SmallRye Mutiny.
Reactive Programming To The Rescue?!
Offers non-blocking I/O by letting a
running thread make a blocking call.
Executes the rest of the program without
waiting for data from storage or the
network.
Reactive Programming To The Rescue?!
Offers non-blocking
I/O by letting a
running thread make a
blocking call.
Executes the rest of
the program without
waiting for data from
storage or the
network.
It keeps an event loop that
continuously checks whether the
socket received data.
Reactive Programming To The Rescue?!
Offers non-
blocking I/O by
letting a running
thread make a
blocking call.
Executes the rest of
the program
without waiting for
data from storage
or the network.
It keeps an event loop that
continuously checks whether the
socket received data.
Once data is received it will be
processed by another thread, so the
running thread does not get blocked.
Virtual Threads To The Rescue
A thread managed
by JVM scheduler
can get a task
assigned by you.
Java scheduler
assigns the virtual
thread to platform
thread(s).
Virtual thread asks platform
thread(s) to perform the task.
If a virtual thread has some blocking
I/O operation, it will be detached from
the platform thread.
Another virtual thread is assigned to the
platform thread so that the platform thread
stays in a running state
JEP 425 Virtual Threads (Preview)
Readable Code with Virtual Threads
Create one new virtual thread per task
Explicitly start a virtual thread
Maintainable Code with Virtual Threads
Explicitly start a virtual thread
Execute 1000 tasks
Maintainable Code with Virtual Threads
Create one new virtual thread per task
Unblocking Virtual Threads
sun.nio.ch.Poller thread
creates a map between the blocked
virtual thread and its corresponding
socket where data will be received.
Poller thread is a continuous
event loop that checks whether
the socket mapped to a
particular thread received data
or not.
java.internal.vm.Continuation
is a public low-level API that is used
in virtual threads, it can yield and
continue whenever required.
Herding Virtual Threads
JEP 428 Structured Concurrency (Incubator)
Herding Virtual Threads
JEP 428 Structured Concurrency (Incubator)
Herding Virtual Threads
JEP 428 Structured Concurrency (Incubator)
Benefits for High Scaling Applications
Higher throughput when having high
number concurrent requests, with fewer
CPU operations and threads spending
significant time waiting.
When having blocking calls, you can
scale well because virtual threads will go
in a waiting state until they receive data
while platform threads will continuously
use the CPU.
Cloud Native Java software is highly
distributed, evolves with the language, tools
and frameworks, and operates in a constantly
changing environment.
Faster, Safer, Easier Java-to-
Native Integration
JNI
From Unsafe To Proper Handling
Create an object without
running its constructor
Directly access hardware
features or the CPU
Manually manage off-heap
memory
Foreign Function & Memory API
Get lookup object for string library
Get method handler for strlen
Convert string to store it in
the off-heap memory
Invoke foreign function
JExtract From Native C Headers
export C_INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs
jextract --source --output src -t org.unix -I $C_INCLUDE_PATH $C_INCLUDE_PATH/string.h
java --enable-preview --enable-native-access=ALL-UNNAMED --source FFMBenchmark.java
Sustainable Design Impacts
Scalability
(Nested) Record Patterns
Java 16 style for Record Pattern
Java 19 style for Record Pattern
Pattern Matching For Switch
Java 17 (first preview) style
Java 19 (Third Preview) style
newHashMap()to Create Preallocated
HashMaps
Deprecation Of Locale Class Constructors
Before Java 19
After Java 19
Decommissioned Methods In ThreadGroup
• ThreadGroup.destroy()- invocations of this method will be ignored.
• ThreadGroup.getDaemon() – returns the value of the unused daemon flags
• ThreadGroup.isDestroyed() – always returns false.
• ThreadGroup.setDaemon() – sets the daemon flag without any effect.
• ThreadGroup.resume(), ThreadGroup.suspend(), ThreadGroup.stop throw
an UnsupportedOperationException.
It’s That Time(zone) Of The Year
• Chile's DST is delayed by a week in September 2022.
• Iran no longer observes DST after 2022.
• Rename Europe/Kiev to Europe/Kyiv.
• Finish moving duplicate-since-1970 zones to ‘backzone’.
source:
Thank YOU!
Additional Resources
• Java19 All Release Notes: https://www.oracle.com/java/technologies/javase/19all-relnotes.html
• Helidon Nima with Loom https://medium.com/helidon/helidon-n%C3%ADma-helidon-on-virtual-
threads-130bb2ea2088
• Quarkus guide with Virtual Threads: https://quarkus.io/guides/virtual-threads
• SpringBoot & Virtual Threads: https://spring.io/blog/2022/10/11/embracing-virtual-threads
• Loom Lab: https://github.com/nipafx/loom-lab
• Vector Math made easy: https://blogs.oracle.com/javamagazine/post/java-vector-api-simd
• FizzBuzz SIMD Style: https://www.morling.dev/blog/fizzbuzz-simd-style/
• JEP425 https://openjdk.org/jeps/425#java-lang-ThreadGroup
• https://bugs.openjdk.org/browse/JDK-8294042
• https://bugs.openjdk.org/browse/JDK-8292654

More Related Content

PDF
Beyond JVM - YOW Melbourne 2013
PDF
Geek out 2014-lagergren-final
PPTX
A tour of Java and the JVM
PPTX
FOSDEM 2017 - Open J9 The Next Free Java VM
PPTX
GOTO Night with Charles Nutter Slides
PDF
Here comes the Loom - Ya!vaConf.pdf
PDF
Inside JVM
PPTX
Loom promises: be there!
Beyond JVM - YOW Melbourne 2013
Geek out 2014-lagergren-final
A tour of Java and the JVM
FOSDEM 2017 - Open J9 The Next Free Java VM
GOTO Night with Charles Nutter Slides
Here comes the Loom - Ya!vaConf.pdf
Inside JVM
Loom promises: be there!

Similar to How Java 19 Influences the Future of Your High-Scale Applications .pdf (20)

PDF
10 Reasons Why Java Now Rocks More Than Ever
PPT
Java multi threading
PPT
Introduction to Real Time Java
PPT
Optimizing your java applications for multi core hardware
PPTX
Advance Android Application Development
PDF
New hope is comming? Project Loom.pdf
PDF
PDF
NDK Primer (Wearable DevCon 2014)
PPT
PPT
PDF
NDK Primer (AnDevCon Boston 2014)
PDF
An Introduction to Java Compiler and Runtime
PDF
Java Threads: Lightweight Processes
PDF
Java Memory Model
PDF
JVM Under the Hood
PDF
Java 40 versions_sgp
PDF
What's Inside a JVM?
PPTX
Mobile Application Development- Configuration and Android Installation
PDF
J9: Under the hood of the next open source JVM
PPTX
Java is a new language on the mainframe
10 Reasons Why Java Now Rocks More Than Ever
Java multi threading
Introduction to Real Time Java
Optimizing your java applications for multi core hardware
Advance Android Application Development
New hope is comming? Project Loom.pdf
NDK Primer (Wearable DevCon 2014)
NDK Primer (AnDevCon Boston 2014)
An Introduction to Java Compiler and Runtime
Java Threads: Lightweight Processes
Java Memory Model
JVM Under the Hood
Java 40 versions_sgp
What's Inside a JVM?
Mobile Application Development- Configuration and Android Installation
J9: Under the hood of the next open source JVM
Java is a new language on the mainframe
Ad

More from Ana-Maria Mihalceanu (20)

PDF
Empower Inclusion Through Accessible Java Applications
PDF
Java 25 and Beyond - A Roadmap of Innovations
PDF
Sécuriser les Applications Java Contre les Menaces Quantiques
PDF
Des joyaux de code natif aux trésors Java avec jextract
PDF
From native code gems to Java treasures with jextract
PDF
Exciting Features and Enhancements in Java 23 and 24
PDF
Monitoring Java Application Security with JDK Tools and JFR Events
PDF
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
PDF
From native code gems to Java treasures with jextract
PDF
Monitoring Java Application Security with JDK Tools and JFR Events
PDF
Java 23 and Beyond - A Roadmap Of Innovations
PDF
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
PDF
Monitoring Java Application Security with JDK Tools and JFR Events
PDF
Java 22 and Beyond- A Roadmap of Innovations
PDF
Surveillance de la sécurité des applications Java avec les outils du JDK e...
PDF
A Glance At The Java Performance Toolbox
PDF
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
PDF
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
PDF
Java 21 Language Features and Beyond
PDF
From Java 17 to 21- A Showcase of JDK Security Enhancements
Empower Inclusion Through Accessible Java Applications
Java 25 and Beyond - A Roadmap of Innovations
Sécuriser les Applications Java Contre les Menaces Quantiques
Des joyaux de code natif aux trésors Java avec jextract
From native code gems to Java treasures with jextract
Exciting Features and Enhancements in Java 23 and 24
Monitoring Java Application Security with JDK Tools and JFR Events
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
From native code gems to Java treasures with jextract
Monitoring Java Application Security with JDK Tools and JFR Events
Java 23 and Beyond - A Roadmap Of Innovations
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Monitoring Java Application Security with JDK Tools and JFR Events
Java 22 and Beyond- A Roadmap of Innovations
Surveillance de la sécurité des applications Java avec les outils du JDK e...
A Glance At The Java Performance Toolbox
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Java 21 Language Features and Beyond
From Java 17 to 21- A Showcase of JDK Security Enhancements
Ad

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Big Data Technologies - Introduction.pptx
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?

How Java 19 Influences the Future of Your High-Scale Applications .pdf

  • 1. How Java 19 Influences The Future Of Your High-Scale Applications
  • 2. Java Champion Alumni, Certified Architect Senior Developer Advocate Passionate about solving complex scenarios involving Java and Kubernetes. @ammbra1508.mastodon.social
  • 3. Any Change Starts with Why
  • 4. Why is Scalability Important? Can cause service disruptions that drive end users away. Impacts a business’s ability to meet demands that continuously change. Reduces IT costs when demand is less, and the system(s) should downscale.
  • 5. Types of Scalability Vertical Scaling Increase RAM/CPU Increase the number of machines Horizontal Scaling
  • 8. Application Scalability An application's ability to handle a growing number of users and load. Not compromising on performance or causing disruptions to user experience when demand increases. Measured by the number of requests it can effectively support simultaneously.
  • 9. Scaling Through Elastic Adjustments A combination of improvements to network bandwidth, CPU and memory requirements, and hard disk adjustments. Application needs to be correctly configured, align the right software protocols and hardware to meet increasing number of requests per seconds.
  • 10. Write Once, Run Anywhere
  • 11. A Partial History Of Running Anywhere During the 1970s, computer science focused on increasing the complexity of computer architectures. Semiconductor technology favoured a type of computer architecture capable to of complex instruction set computers (CISCs).
  • 12. From CISC to RISC C. David Patterson and Carlo Sequin from the University of California at Berkeley thought that by simplifying the processor a better performance can be achieved at a much lower cost. This hypothesis translated into RISC, reduced instruction set computer.
  • 13. Key Features of RISC-V Simple instruction set Modularity Extensibility Open Standard Load-store architecture *At the moment, RISC-V still has limited hardware support.
  • 14. The port will support the HotSpot subsystems The template interpreter The C1 (client) JIT compiler The C2 (server) JIT compiler All current mainline GCs, including ZGC and Shenandoah. JEP 422 focuses on integration of the Linux/RISC-V port into the JDK main-line repository.
  • 15. From ISA To SIMD RISC-V is a free and open- source RISC instruction set architecture (ISA) CPU architectures include extensions to their instructions sets that allow applying a single instruction to multiple data items simultaneously (SIMD). Heterogeneous ISAs offer clock speed/parallelism tradeoffs for workloads with frequent usage of SIMD instructions.
  • 17. Portable Java ~ Efficient Java
  • 18. Coding Style of Choice Synchronous Asynchronous
  • 20. Platform Threads and Scaling Platform threads take up considerable memory to exist. When you have lots of blocking I/O, threads are just waiting for data, and the CPU is not utilized to its full capacity. Context switch for platform threads is costly in terms of resources.
  • 21. Reactive Programming To The Rescue?! Offers non-blocking I/O by letting a running thread make a blocking call. Analysing the performance and costs of reactive programming libraries in Java focuses on RxJava, Project Reactor, SmallRye Mutiny.
  • 22. Reactive Programming To The Rescue?! Offers non-blocking I/O by letting a running thread make a blocking call. Executes the rest of the program without waiting for data from storage or the network.
  • 23. Reactive Programming To The Rescue?! Offers non-blocking I/O by letting a running thread make a blocking call. Executes the rest of the program without waiting for data from storage or the network. It keeps an event loop that continuously checks whether the socket received data.
  • 24. Reactive Programming To The Rescue?! Offers non- blocking I/O by letting a running thread make a blocking call. Executes the rest of the program without waiting for data from storage or the network. It keeps an event loop that continuously checks whether the socket received data. Once data is received it will be processed by another thread, so the running thread does not get blocked.
  • 25. Virtual Threads To The Rescue A thread managed by JVM scheduler can get a task assigned by you. Java scheduler assigns the virtual thread to platform thread(s). Virtual thread asks platform thread(s) to perform the task. If a virtual thread has some blocking I/O operation, it will be detached from the platform thread. Another virtual thread is assigned to the platform thread so that the platform thread stays in a running state JEP 425 Virtual Threads (Preview)
  • 26. Readable Code with Virtual Threads Create one new virtual thread per task Explicitly start a virtual thread
  • 27. Maintainable Code with Virtual Threads Explicitly start a virtual thread Execute 1000 tasks
  • 28. Maintainable Code with Virtual Threads Create one new virtual thread per task
  • 29. Unblocking Virtual Threads sun.nio.ch.Poller thread creates a map between the blocked virtual thread and its corresponding socket where data will be received. Poller thread is a continuous event loop that checks whether the socket mapped to a particular thread received data or not. java.internal.vm.Continuation is a public low-level API that is used in virtual threads, it can yield and continue whenever required.
  • 30. Herding Virtual Threads JEP 428 Structured Concurrency (Incubator)
  • 31. Herding Virtual Threads JEP 428 Structured Concurrency (Incubator)
  • 32. Herding Virtual Threads JEP 428 Structured Concurrency (Incubator)
  • 33. Benefits for High Scaling Applications Higher throughput when having high number concurrent requests, with fewer CPU operations and threads spending significant time waiting. When having blocking calls, you can scale well because virtual threads will go in a waiting state until they receive data while platform threads will continuously use the CPU.
  • 34. Cloud Native Java software is highly distributed, evolves with the language, tools and frameworks, and operates in a constantly changing environment.
  • 35. Faster, Safer, Easier Java-to- Native Integration
  • 36. JNI
  • 37. From Unsafe To Proper Handling Create an object without running its constructor Directly access hardware features or the CPU Manually manage off-heap memory
  • 38. Foreign Function & Memory API Get lookup object for string library Get method handler for strlen Convert string to store it in the off-heap memory Invoke foreign function
  • 39. JExtract From Native C Headers export C_INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs jextract --source --output src -t org.unix -I $C_INCLUDE_PATH $C_INCLUDE_PATH/string.h java --enable-preview --enable-native-access=ALL-UNNAMED --source FFMBenchmark.java
  • 41. (Nested) Record Patterns Java 16 style for Record Pattern Java 19 style for Record Pattern
  • 42. Pattern Matching For Switch Java 17 (first preview) style Java 19 (Third Preview) style
  • 44. Deprecation Of Locale Class Constructors Before Java 19 After Java 19
  • 45. Decommissioned Methods In ThreadGroup • ThreadGroup.destroy()- invocations of this method will be ignored. • ThreadGroup.getDaemon() – returns the value of the unused daemon flags • ThreadGroup.isDestroyed() – always returns false. • ThreadGroup.setDaemon() – sets the daemon flag without any effect. • ThreadGroup.resume(), ThreadGroup.suspend(), ThreadGroup.stop throw an UnsupportedOperationException.
  • 46. It’s That Time(zone) Of The Year • Chile's DST is delayed by a week in September 2022. • Iran no longer observes DST after 2022. • Rename Europe/Kiev to Europe/Kyiv. • Finish moving duplicate-since-1970 zones to ‘backzone’. source:
  • 48. Additional Resources • Java19 All Release Notes: https://www.oracle.com/java/technologies/javase/19all-relnotes.html • Helidon Nima with Loom https://medium.com/helidon/helidon-n%C3%ADma-helidon-on-virtual- threads-130bb2ea2088 • Quarkus guide with Virtual Threads: https://quarkus.io/guides/virtual-threads • SpringBoot & Virtual Threads: https://spring.io/blog/2022/10/11/embracing-virtual-threads • Loom Lab: https://github.com/nipafx/loom-lab • Vector Math made easy: https://blogs.oracle.com/javamagazine/post/java-vector-api-simd • FizzBuzz SIMD Style: https://www.morling.dev/blog/fizzbuzz-simd-style/ • JEP425 https://openjdk.org/jeps/425#java-lang-ThreadGroup • https://bugs.openjdk.org/browse/JDK-8294042 • https://bugs.openjdk.org/browse/JDK-8292654