HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
JVM Mechanics: Understanding the JIT's TricksDoug Hawkins
Ā
In this talk, we'll walkthrough how the JIT optimizes a piece Java code step-by-step. In doing so, you'll learn some of the amazing feats of optimization that JVMs can perform, but also some surprisingly simple things that prevent your code from running fast.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Ā
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
JVM Mechanics: Understanding the JIT's TricksDoug Hawkins
Ā
In this talk, we'll walkthrough how the JIT optimizes a piece Java code step-by-step. In doing so, you'll learn some of the amazing feats of optimization that JVMs can perform, but also some surprisingly simple things that prevent your code from running fast.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Ā
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
Graal is a dynamic meta-circular research compiler for Java that is designed for extensibility and modularity. One of its main distinguishing elements is the handling of optimistic assumptions obtained via profiling feedback and the representation of deoptimization guards in the compiled code. Truffle is a self-optimizing runtime system on top of Graal that uses partial evaluation to derive compiled code from interpreters. Truffle is suitable for creating high-performance implementations for dynamic languages with only moderate effort. The presentation includes a description of the Truffle multi-language API and performance comparisons within the industry of current prototype Truffle language implementations (JavaScript, Ruby, and R). Both Graal and Truffle are open source and form themselves research platforms in the area of virtual machine and programming language implementation (http://openjdk.java.net/projects/graal/).
The Loom project has been under work for many years, and just delivered Virtual Threads as a preview feature in the JDK 19. We now have a very precise idea of what they are and what you can do with them. Our good old Threads, created more than 25 years ago, will see a new kind of lightweight threads. This presentation shows you that creating a thread is easier and much cheaper, allowing the creation of millions of them in a single JVM. These virtual threads can be block at almost no cost. These new virtual threads bring with them new notions that will be covered in this talk. Loom threads are coming, and they will change the landscape of concurrent programming in Java.
Fast as C: How to Write Really Terrible JavaCharles Nutter
Ā
For years weāve been told that the JVMās amazing optimizers can take your running code and make it āfastā or āas fast as C++ā or āas fast as Cāā¦or sometimes āfaster than Cā. And yet we donāt often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, weāll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. Weāll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
An Overview of Deserialization Vulnerabilities in the Java Virtual Machine (J...joaomatosf_
Ā
Slides of the talk presented in the Hackers to Hackers Conference 2017 (H2HC 2017)
This talk discussed (a little bit deep) the root cause of these vulnerabilities in the context of the JVM
While most bugs reveal their cause within their stack trace, Javaās OutOfMemoryError is less talkative and therefore regarded as being difficult to debug by a majority of developers. With the right techniques and tools, memory leaks in Java programs can however be tackled like any other programming error. This talks discusses how a JVM stores data, categorizes different types of memory leaks that can occur in a Java program and presents techniques for fixing such errors. Furthermore, we will have a closer look at lambda expressions and their considerable potential of introducing memory leaks when they are used incautiously.
Java DataBase Connectivity API (JDBC API)Luzan Baral
Ā
JDBC is a Java-based data access technology (Java Standard Edition platform) from Oracle Corporation. This technology is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any ODBC-accessible data source in the JVM host environment.
Writing software for a virtual machine enables developers to forget about machine code assembly, interrupts, and processor caches. This makes Java a convenient language, but all too many developers see the JVM as a black box and are often unsure of how to optimize their code for performance. This unfortunately adds credence to the myth that Java is always outperformed by native languages. This session takes a peek at the inner workings of Oracleās HotSpot virtual machine, its just-in-time compiler, and the interplay with a computerās hardware. From this, you will understand the more common optimizations a virtual machine applies, to be better equipped to improve and reason about a Java programās performance and how to correctly measure runtime!
Clean Pragmatic Architecture - Avoiding a MonolithVictor Rentea
Ā
Talk built based on several of my trainings: http://www.victorrentea.ro/#training
Covers: Clean/Onion/Hexagonal Architecture, Domain Entities, Value Objects, Repository, Extract When it Grows Principle, Dependency Inversion Principle, Clean Code and Design Patterns.
These are the backing slides of the talks given at JPoint 2017 and Devoxx PL 2017: https://www.youtube.com/embed/4-4ahz7zDiQ
The Java Virtual Machine (JVM) can deliver significantly better performance through the use of Just In Time compilation. However, each time you start an application it needs to repeat the same process of analysis and compilation. This session discusses Java with Co-ordinated Checkpoint at Restore. This is a way to freeze an application and start it again (potentially many times) from the same checkpoint.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
A 2015 performance study by Brendan Gregg, Nitesh Kant, and Ben Christensen. Original is in https://github.com/Netflix-Skunkworks/WSPerfLab/tree/master/test-results
Graal is a dynamic meta-circular research compiler for Java that is designed for extensibility and modularity. One of its main distinguishing elements is the handling of optimistic assumptions obtained via profiling feedback and the representation of deoptimization guards in the compiled code. Truffle is a self-optimizing runtime system on top of Graal that uses partial evaluation to derive compiled code from interpreters. Truffle is suitable for creating high-performance implementations for dynamic languages with only moderate effort. The presentation includes a description of the Truffle multi-language API and performance comparisons within the industry of current prototype Truffle language implementations (JavaScript, Ruby, and R). Both Graal and Truffle are open source and form themselves research platforms in the area of virtual machine and programming language implementation (http://openjdk.java.net/projects/graal/).
The Loom project has been under work for many years, and just delivered Virtual Threads as a preview feature in the JDK 19. We now have a very precise idea of what they are and what you can do with them. Our good old Threads, created more than 25 years ago, will see a new kind of lightweight threads. This presentation shows you that creating a thread is easier and much cheaper, allowing the creation of millions of them in a single JVM. These virtual threads can be block at almost no cost. These new virtual threads bring with them new notions that will be covered in this talk. Loom threads are coming, and they will change the landscape of concurrent programming in Java.
Fast as C: How to Write Really Terrible JavaCharles Nutter
Ā
For years weāve been told that the JVMās amazing optimizers can take your running code and make it āfastā or āas fast as C++ā or āas fast as Cāā¦or sometimes āfaster than Cā. And yet we donāt often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, weāll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. Weāll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
An Overview of Deserialization Vulnerabilities in the Java Virtual Machine (J...joaomatosf_
Ā
Slides of the talk presented in the Hackers to Hackers Conference 2017 (H2HC 2017)
This talk discussed (a little bit deep) the root cause of these vulnerabilities in the context of the JVM
While most bugs reveal their cause within their stack trace, Javaās OutOfMemoryError is less talkative and therefore regarded as being difficult to debug by a majority of developers. With the right techniques and tools, memory leaks in Java programs can however be tackled like any other programming error. This talks discusses how a JVM stores data, categorizes different types of memory leaks that can occur in a Java program and presents techniques for fixing such errors. Furthermore, we will have a closer look at lambda expressions and their considerable potential of introducing memory leaks when they are used incautiously.
Java DataBase Connectivity API (JDBC API)Luzan Baral
Ā
JDBC is a Java-based data access technology (Java Standard Edition platform) from Oracle Corporation. This technology is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any ODBC-accessible data source in the JVM host environment.
Writing software for a virtual machine enables developers to forget about machine code assembly, interrupts, and processor caches. This makes Java a convenient language, but all too many developers see the JVM as a black box and are often unsure of how to optimize their code for performance. This unfortunately adds credence to the myth that Java is always outperformed by native languages. This session takes a peek at the inner workings of Oracleās HotSpot virtual machine, its just-in-time compiler, and the interplay with a computerās hardware. From this, you will understand the more common optimizations a virtual machine applies, to be better equipped to improve and reason about a Java programās performance and how to correctly measure runtime!
Clean Pragmatic Architecture - Avoiding a MonolithVictor Rentea
Ā
Talk built based on several of my trainings: http://www.victorrentea.ro/#training
Covers: Clean/Onion/Hexagonal Architecture, Domain Entities, Value Objects, Repository, Extract When it Grows Principle, Dependency Inversion Principle, Clean Code and Design Patterns.
These are the backing slides of the talks given at JPoint 2017 and Devoxx PL 2017: https://www.youtube.com/embed/4-4ahz7zDiQ
The Java Virtual Machine (JVM) can deliver significantly better performance through the use of Just In Time compilation. However, each time you start an application it needs to repeat the same process of analysis and compilation. This session discusses Java with Co-ordinated Checkpoint at Restore. This is a way to freeze an application and start it again (potentially many times) from the same checkpoint.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
A 2015 performance study by Brendan Gregg, Nitesh Kant, and Ben Christensen. Original is in https://github.com/Netflix-Skunkworks/WSPerfLab/tree/master/test-results
Five cool ways the JVM can run Apache Spark fasterTim Ellison
Ā
The IBM JVM runs Apache Spark fast! This talk explains some of the findings and optimizations from our experience of running Spark workloads.
The talk was originally presented at the SparkEU Summit 2015 in Amsterdam.
My presentation in SDCC 2012 (http://sdcc.csdn.net/index_en.html). The video recording of this session is available at http://v.csdn.hudong.com/s/article.html?arcid=2810640
This session is all about - the mechanism provided by Java Virtual Machine to reclaim heap space from objects which are eligible for Garbage collection.
Azul Virtual Machine Engineer Douglas Hawkins describes how decisions made by the JVM affect how your code is compiled and run. Learn how this affects application performance and what steps you can take to optimize how the JVM acts on your code.
Presentation given at the Toulouse JUG in Dec 2019
GraalVM and its native-image component allow building native standalone executables from Java or any other language compiling to Java bytecode like Scala or Kotlin.
This talks goes through the practical steps leading to producing a native executable for a command-line tool, explaining the benefits and also the limits of GraalVM native-image.
Learn about the basic fundamentals of java and important for the different company's interview. Topics like JRE, JDK, Java Keywords, Primitive DataTypes, Types of Variables, Logical, Shift and Bitwise Operator working, Command Line Argument, Handling Arrays, Array Copy, and different programs and output based programs.
After reimplement many features several times in different platforms is time to think that it should be a better way. There are many frameworks that allows the developers to write the code once and deploy it "everywhere", but the final result is an app with a non native look and feel or with an emulated look and feel that the users can see and rate according to the quality.
There are other ways to develop apps for multiple platforms without rewriting the same code over and over. I'll talk about one of that ways which consists on developing the core with C++ and implement the UI natively. This method could sound very scary because of the C++ reputation (memory leaks, the standard library, etc), but with C++11 all this has been improved in a very sweet way, so maybe it is time to take an other look at this language and see how can we take advantage of it.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDBās capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
4Developers 2018: Evolution of C++ Class Design (Mariusz ÅapiÅski)PROIDEA
Ā
Since the beginnings of C++, classes are the basic building block of any self-respecting application. The combination of data and its relevant functionality heavily impacts the way we modularize the program, design APIs, construct and reuse the code - think of software in general.
In the previous era, C++ was a hammer for every nail, providing secure high-level abstractions without sacrifice of the superior performance. Yet during the past decades, competing technologies dethroned it out of many domains. As the language evolved to prevail its principal advantages, so did the way classes are programmed.
I am pleased to invite you to a speech about code construction and programming techniques used in programs and libraries now and then. Expect a lot of code samples!
Java's warm-up challenges are starting to receive more attention lately. For the past 4 years, Azul has been shipping ReadyNow -- a solution to Java's warm-up problems as part of their Zing Virtual Machine.
However in building ReadyNow, Azul chose at unconventional but effective approach to solving these warm-up problems.
This talk is a look into some of the surprising performance cases in Java -- with the goal of illustrating a few simple truths about the nature of compilers.
An overview of the inner-workings of OpenJDK - with emphasis on...
- what triggers the just-in-time compiler (JIT)
- types of speculative optimizations performed by the JIT
- aspects of the Java language & ecosystem that make ahead-of-time (AOT) compilation challenging
Inside Android's Dalvik VM - NEJUG Nov 2011Doug Hawkins
Ā
In this presentation, Doug Hawkins will discuss how the Dalvik VM is different from traditional Java VMs and the motivations behind those differences. Along the way, you'll learn about Android's service architecture, Dalvik's byte code format, and the surprising details of how Android installs, launches, and executes applications.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Ā
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Ā
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
Ā
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
Ā
As AI technology is pushing into IT I was wondering myself, as an āinfrastructure container kubernetes guyā, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefitās both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
Ā
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Ā
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overviewā
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
Ā
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. Whatās changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Ā
Clients donāt know what they donāt know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clientsā needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Ā
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Ā
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
Ā
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
"Impact of front-end architecture on development cost", Viktor Turskyi
Ā
JVM Mechanics: When Does the JVM JIT & Deoptimize?
1. Douglas Q. Hawkins
VM Engineer
VM MechanicsWhen Does the JVM JIT & Deoptimize?
J
https://github.com/dougqh/jvm-mechanics
2. About Azul Systems
ZuluĀ®
Multi-Platform OpenJDK
Cloud Support including Docker and Azure
Embedded Support
ZingĀ®
Highly ScalableVM
Continuously Concurrent Compacting Collector
ReadyNow! for Low Latency Applications
http://www.azulsystems.com/
5. public class SimpleProgram {
static final int CHUNK_SIZE = 1_000;
public static void main(String[] args) {
for ( int i = 0; i < 250; ++i ) {
long startTime = System.nanoTime();
for ( int j = 0; j < CHUNK_SIZE; ++j ) {
new Object();
}
long endTime = System.nanoTime();
System.out.printf("%dt%d%n", i, endTime - startTime);
}
}
}
A Simple Program
example01a.SimpleProgram
Code Reference
8. public class NotSoSimpleProgram {
static final int CHUNK_SIZE = 1_000;
public static void main(String[] args) {
Object trap = null;
for ( int i = 0; i < 250; ++i ) {
long startTime = System.nanoTime();
for ( int j = 0; j < CHUNK_SIZE; ++j ) {
new Object();
if ( trap != null ) {
System.out.println("trap!");
trap = null;
}
}
if ( i == 200 ) trap = new Object();
long endTime = System.nanoTime();
System.out.printf("%dt%d%n", i, endTime - startTime);
}
}
}
Not So Simple Program
example01b.NotSoSimpleProgram
16. Invisible Overloads
via Bridge Methods
public interface Supplier<T> {
public abstract T get();
}
new Supplier<String>() {
public ļ¬nal String get() { return āfooā; }
};
145 4 InvisibleOverload$1::get (5 bytes)
145 5 InvisibleOverload$1::get (3 bytes)
17. public class BackedgeCounter {
public static void main(final String[] args)
throws InterruptedException
{
for ( int i = 0; i < 20_000; ++i ) {
hotMethod();
}
System.out.println("Waiting for compiler...");
Thread.sleep(5_000);
for ( int i = 0; i < 20_000; ++i ) {
hotMethod();
}
System.out.println("Waiting for compiler...");
Thread.sleep(5_000);
}
static void hotMethod() {}
}
Backedge Counter
example03.BackedgeCounter
20. Both Counters
public class BothCounters {
public static void main(final String[] args)
throws InterruptedException
{
for ( int i = 0; i < 2; ++i ) {
outerMethod();
}
System.out.println("Waiting for compiler...");
Thread.sleep(5000);
}
static void outerMethod() {
for ( int i = 0; i < 10_000; ++i ) {
innerMethod();
}
}
static void innerMethod() {}
}
example04.BothCounters
23. C1 ClientVM
The Fast Acting Compiler
Compiles with Count > 1,000
(2,000 in Tiered)
Produces Compilations Quickly
Generated Code Runs Relatively Slowly
24. Compiles with Count > 10,000
(15,000 in Tiered)
Proļ¬le Guided
C2 ServerVM
The Smart compiler
Speculative
2xSpeed!
Produces Compilations Slowly
Generated Code Runs Fast
25. Tiered Compilation
Available in Java 7 - default in Java 8
Best of Both Worlds - C1 & C2
Interpreter
> 2,000 > 15,000
C1 C2
http://www.slideshare.net/maddocig/tiered
27. public final class TieredCompilation {
public static final void main(final String[] args)
throws InterruptedException
{
for ( int i = 0; i < 3_000; ++i ) {
method();
}
System.out.println("Waiting for the compiler...");
Thread.sleep(5_000);
for ( int i = 0; i < 20_000; ++i ) {
method();
}
System.out.println("Waiting for the compiler...");
Thread.sleep(5_000);
}
private static final void method() {
// Do something while doing nothing.
System.out.print('0');
}
}
example05.TieredCompilation
Tiered Compilation
31. Intrinsics
Special code built-into theVM for a particular method
Built-in to theVM - not written in Java (usually)
For Example...
System.arraycopy
Math.sin / cos / tan
Often use special hardware capabilities:
MMX,AVX2, etc
37. Intrinsic Inlining
public class Intrinsics {
public static void main(String[] args)
throws InterruptedException
{
int[] data = randomInts(100_000);
int min = Integer.MAX_VALUE;
for ( int x: data ) {
min = Math.min(min, x);
}
Thread.sleep(5_000);
System.out.println(min);
}
static final int[] randomInts(int size) {
ā¦
}
}
example06.Intrinsics
39. Direct Call Inlining
public class Inlining {
public static void main(String[] args)
throws InterruptedException
{
System.setOut(new NullPrintStream());
for ( int i = 0; i < 20_000; ++i ) {
hotMethod();
}
Thread.sleep(5_000);
}
public static void hotMethod() {
System.out.println(square(7));
System.out.println(square(9));
}
static int square(int x) {
return x * x;
}
}
public static void hotMethod() {
System.out.println(7 * 7);
System.out.println(9 * 9);
}
example07.DirectInlining
static, private, constructor calls
40. Direct Call Inlining
226 53 example07.DirectInlining::hotMethod (23 bytes)
@ 5 example07.DirectInlining::square (4 bytes) inline (hot)
!m @ 8 java.io.PrintStream::println (24 bytes) already compiled into a big method
@ 16 example07.DirectInlining::square (4 bytes) inline (hot)
!m @ 19 java.io.PrintStream::println (24 bytes) already compiled into a big method
228 54 % example07.DirectInlining::main @ 15 (35 bytes)
@ 15 example07.DirectInlining::hotMethod (23 bytes) inline (hot)
@ 5 example07.DirectInlining::square (4 bytes) inline (hot)
!m @ 8 java.io.PrintStream::println (24 bytes) already compiled into a big method
@ 16 example07.DirectInlining::square (4 bytes) inline (hot)
!m @ 19 java.io.PrintStream::println (24 bytes) already compiled into a big method
-XX:+PrintCompilation
-XX:+UnlockDiagnosticVMOptions
-XX:+PrintInlining
41. Printing Assembly
for a Method
Download hsdis-amd64 dynamic library
Copy to jre/lib directory
Run HotSpot with...
-XX:+UnlockDiagnosticVMOptions
-XX:CompileCommand=print,{package/Class::method}
43. Escape Analysis
long sum = 0;
for ( Long x: list ) {
sum += iter.next();
}
long sum = 0;
for ( Iterator<Long> iter = list.iterator();
iter.hasNext(); )
{
sum += iter.next();
}
44. Escape Analysis
http://psy-lob-saw.blogspot.ru/2014/12/the-escape-of-arraylistiterator.html
long sum = 0;
// ArrayList$Itr.<init>
int iter$size = list.size();
int iter$cursor = 0;
int iter$lastRet = -1;
āØ
// ArrayList$Itr.hasNext
for ( ; iter$cursor != iter$size; ) {
// ArrayList$Itr.next
int i = iter$cursor;
Object[] elementData = list.elementData;
iter$cursor = i + 1;
Long x = (Long)elementData[iter$lastRet = i];
sum += x;
}
45. public class SimpleProgram {
static final int CHUNK_SIZE = 1_000;
public static void main(String[] args) {
for ( int i = 0; i < 250; ++i ) {
long startTime = System.nanoTime();
for ( int j = 0; j < CHUNK_SIZE; ++j ) {
//new ObjectāØ
obj = calloc(sizeof(Object));
obj.<init>(); // call ctor - empty
}
long endTime = System.nanoTime();
System.out.printf(
"%dt%d%n", i, endTime - startTime);
}
}
}
Simple Program Revisited
1: inlined
2: escape analysis /
dead store
3: empty loop /
eliminate loop
example01a.SimpleProgram
63. Beyond Monomorphic
Func func = ā¦
double result = func.apply(20);
Func func = ā¦
//no type guard!
double result = 20 * 20;
More Types?
64. example10b.ChaStorm
public class ChaStorm {
public static void main(String[] args)
throws InterruptedException
{
Func func = new Square();
for ( int i = 0; i < 10_000; ++i ) {
apply1(func, i);
ā¦
apply8(func, i);
}
System.out.println("Waiting for compiler...");
Thread.sleep(5_000);
System.out.println("Deoptimize...");
System.out.println(Sqrt.class);
Thread.sleep(5_000);
}
}
Potential for Deopt Storm
65. Potential for Deopt Storm
152 1 java.lang.String::hashCode (55 bytes)
166 2 example10.support.Square::apply (4 bytes)
173 3 example10b.ChaStorm::apply1 (7 bytes)
173 4 example10b.ChaStorm::apply2 (7 bytes)
Waiting for compiler...
174 5 example10b.ChaStorm::apply3 (7 bytes)
174 6 example10b.ChaStorm::apply4 (7 bytes)
174 7 example10b.ChaStorm::apply5 (7 bytes)
174 8 example10b.ChaStorm::apply6 (7 bytes)
174 9 example10b.ChaStorm::apply7 (7 bytes)
174 10 example10b.ChaStorm::apply8 (7 bytes)
Deoptimize...
5176 9 example10b.ChaStorm::apply7 (7 bytes) made not entrant
5176 8 example10b.ChaStorm::apply6 (7 bytes) made not entrant
5176 7 example10b.ChaStorm::apply5 (7 bytes) made not entrant
5176 5 example10b.ChaStorm::apply3 (7 bytes) made not entrant
5176 6 example10b.ChaStorm::apply4 (7 bytes) made not entrant
5176 4 example10b.ChaStorm::apply2 (7 bytes) made not entrant
5176 3 example10b.ChaStorm::apply1 (7 bytes) made not entrant
5176 10 example10b.ChaStorm::apply8 (7 bytes) made not entrant
class example10.support.Sqrt
-XX:+PrintCompilation
66. Another Way to Deopt
Bail to Interpreter
Keep Compile?
Yes No, recompile when...
Now Later (Proļ¬le More)
class load!
stop the world,
deopt now!
67. Total time for which application threads were stopped: 0.0001010 seconds
5096 10 example10b.ChaStorm::apply8 (7 bytes) made not entrant
5096 8 example10b.ChaStorm::apply6 (7 bytes) made not entrant
5096 7 example10b.ChaStorm::apply5 (7 bytes) made not entrant
5096 5 example10b.ChaStorm::apply3 (7 bytes) made not entrant
5096 6 example10b.ChaStorm::apply4 (7 bytes) made not entrant
5096 4 example10b.ChaStorm::apply2 (7 bytes) made not entrant
5096 9 example10b.ChaStorm::apply7 (7 bytes) made not entrant
5096 3 example10b.ChaStorm::apply1 (7 bytes) made not entrant
vmop [threads: total initially_running wait_to_block] ā¦
5.096: Deoptimize [ 7 0 0 ] ā¦
Another Way to Deopt
-XX:+PrintCompilation
-XX+PrintSafepointStatistics
-XX:PrintSafepointStatisticsCount=1
http://blog.ragozin.info/2012/10/safepoints-in-hotspot-jvm.html
68. Bimorphic
Func func = ā¦
double result = func.apply(20);
Func func = ā¦
//no type guard!
double result = 20 * 20;
add another type
Func func = ā¦
double result;
if ( func.getClass().equals(Square.class) ) {
result = 20 * 20;
} else {
uncommon_trap(class_check);
}
give up!
69. public class ClassDevirtualization {
public static void main(String[] args) throws InterruptedException {
System.out.println("Using Square...");
Func func = new Square();
for ( int i = 0; i < 20_000; ++i ) {
apply1(func, i);
apply2(func, i);
}
Thread.sleep(5_000);
System.out.printf("Loading %s to Deopt Now!%nā, Sqrt.class);
System.out.println("Keep using Square in apply1...");
func = new Square();
for ( int i = 0; i < 20_000; ++i ) apply1(func, i);
Thread.sleep(5_000);
System.out.println("Use AlsoSquare in apply1...");
func = new AlsoSquare();
for ( int i = 0; i < 20_000; ++i ) apply1(func, i);
Thread.sleep(5_000);
System.out.println("Use AnotherSquare in apply1...");
func = new AnotherSquare();
for ( int i = 0; i < 20_000; ++i ) apply1(func, i);
Thread.sleep(5_000);
ā¦after 3 types no more deoptsā¦
}
}
stop the world,
deopt now!
class check
deopt!
bimorphic
deopt!
example10c.ClassDevirtualization
Class Devirtualization
70. 89 1 java.lang.String::hashCode (55 bytes)
Using Square...
104 2 example10.support.Square::apply (4 bytes)
105 3 example10c.ClassDevirtualization::apply1 (7 bytes)
105 4 example10c.ClassDevirtualization::apply2 (7 bytes)
106 5 % example10c.ClassDevirtualization::main @ 21 (240 bytes)
5116 5 % example10c.ClassDevirtualization::main @ -2 (240 bytes) made not entrant
5116 4 example10c.ClassDevirtualization::apply2 (7 bytes) made not entrant
5116 3 example10c.ClassDevirtualization::apply1 (7 bytes) made not entrant
Loading class example10.support.Sqrt to Deoptimize Now!
Keep using Square in apply1...
5128 6 example10c.ClassDevirtualization::apply1 (7 bytes)
5128 7 % example10c.ClassDevirtualization::main @ 88 (240 bytes)
Use AlsoSquare in apply1...
10131 6 example10c.ClassDevirtualization::apply1 (7 bytes) made not entrant
10131 8 example10c.ClassDevirtualization::apply1 (7 bytes)
10132 9 % example10c.ClassDevirtualization::main @ 131 (240 bytes)
Use AnotherSquare in apply1...
15134 8 example10c.ClassDevirtualization::apply1 (7 bytes) made not entrant
15134 10 example10c.ClassDevirtualization::apply1 (7 bytes)
15135 11 % example10c.ClassDevirtualization::main @ 174 (240 bytes)
Use YetAnotherSquare in apply1...
20139 12 % example10c.ClassDevirtualization::main @ 217 (240 bytes)
Class Devirtualization
-XX:+PrintCompilation
71. WorseYet...
class AlsoSquare extends Square {}
class AnotherSquare extends Square {}
class Square extends Func {
double ļ¬nal apply(double x) {
return x * x;
}
}
classYetAnotherSquare extends Square {}
78. āFunā with Uninitialized
public class UninitializedForever {
static class Uninitialized {
static {
if ( true ) throw new RuntimeException();
}
}
public static void main(String[] args) {
for ( int i = 0; i < 100_000; ++i ) {
try {
new Uninitialized();
} catch ( Throwable t ) {
// ignore
}
}
}
}
example11b.UnintializedForever
80. null_check unexpected null or zero divisor
null_assert unexpected non-null or non-zero
range_check unexpected array index
class_check unexpected object class
array_check unexpected array class
intrinsic unexpected operand to intrinsic
bimorphic unexpected object class in bimorphic inlining
unloaded unloaded class or constant pool entry
uninitialized bad class state (uninitialized)
unreached code is not reached, compiler
unhandled arbitrary compiler limitation
constraint arbitrary runtime constraint violated
div0_check a null_check due to division by zero
age nmethod too old; tier threshold reached
predicate compiler generated predicate failed
loop_limit_check compiler generated loop limits check failed
Reasons for Deoptimizing...
81. none just interpret, do not invalidate nmethod
maybe_recompile recompile the nmethod; need not invalidate
make_not_entrant invalidate the nmethod, recompile (probably)
reinterpret invalidate the nmethod, reset IC, maybe recompile
make_not_compilable invalidate the nmethod and do not compile
Actions When
Deoptimizing...
82. Bail to Interpreter
Keep Compile?
Yes, recompile? No, recompile when...
Now Later (Proļ¬le More)No Yes
none
maybe
recompile
make
not entrant
reinterpret
class load!
stop the world,
deopt now!
uncommon trap!