Java 9 high performance
Best practices to adapt and bottlenecks to avoid About This Book Tackle all kinds of performance-related issues and streamline your development Master the new features and new APIs of Java 9 to implement highly efficient and reliable codes Gain an in-depth knowledge of Java application performance a...
Other Authors: | , |
---|---|
Format: | eBook |
Language: | Inglés |
Published: |
Birmingham, England ; Mumbai, [India] :
Packt Publishing
2017.
|
Edition: | 1st edition |
Subjects: | |
See on Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630368806719 |
Table of Contents:
- Cover
- Title Page
- Copyright
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: Learning Java 9 Underlying Performance Improvements
- Introducing the new features of Java 9
- Modular development and its impact
- Quick introduction to modules
- String operations performance
- Compact string
- The world of heap
- Why bother compressing strings?
- What did they do?
- What is the escape route?
- What is the performance gain?
- Indify String Concatenation
- Invokedynamic
- Storing interned strings in CDS archives
- Concurrency performance
- Compiler improvements
- Tiered Attribution
- Ahead-of-Time compilation
- Security manager improvements
- Graphics rasterizers
- Summary
- Chapter 2: Identifying Performance Bottlenecks
- CPU infrastructure
- Memory utilization
- Java heap
- Java stack
- Java heap versus stack memory
- Escape analysis
- Common memory problems
- OutOfMemory
- Mismanagement of object life cycle: java.lang.OutOfMemoryError: Java heap space
- java.lang.OutOfMemoryError: GC Overhead limit exceeded
- java.lang.OutOfMemoryError: Permgen space
- java.lang.OutOfMemoryError: Metaspace
- java.lang.OutOfMemoryError: Unable to create new native thread
- java.lang.OutOfMemoryError: request size bytes for reason
- java.lang.OutOfMemoryError: Requested array size exceeds VM limit
- Out of memory: kill process or sacrifice child
- StackOverFlow
- Database operations
- I/O operations
- Network operations
- WebSocket Client API
- Summary
- Chapter 3: Learning How to Troubleshoot Code
- Measuring performance
- Performance checklist
- Basic principles of troubleshooting
- Why some developers find troubleshooting difficult?
- Setting up the environment for troubleshooting
- Importance of error handling.
- A basic try-catch-finally block and its usages
- What are try-catch-finally blocks?
- Usage of try-catch-finally blocks
- Mistakes programmers make when using error handling
- Why swallowing exception is bad?
- Use of logging
- Logging vs Debugging
- What are the main components?
- How to do logging?
- What logging frameworks are available?
- Java Util Logging
- Log4j 2
- Logback
- Performance
- Support
- Ease of Use
- Best use case for logging
- Analyzing thread dump
- What is a thread dump?
- Benefits of thread dump analysis
- How to collect a thread dump
- How to analyze a thread dump
- Best practices
- Analyzing heap dump
- What is a heap dump
- Benefits of analyzing heap dumps
- When do you analyze a heap dump
- How to collect heap dump
- How to analyze heap dump
- Best practices
- Summary
- Chapter 4: Learning How to Use Profiling Tools
- Introducing profiling
- Why a developer should use a profiling tool
- The art of profiling
- Profiling areas
- CPU profiling
- Memory profiling
- Thread profiling
- The different types of Java profiling tool
- Jmap
- VisualVM
- JProfiler
- XRebel
- YourKit
- JRockit
- BTrace
- AQtime
- Reporting issues
- Summary
- Chapter 5: Understanding Garbage Collection and Making Use of It
- Understanding the Java 9 garbage collector for top optimization
- Garbage Collection
- The principle of GC
- Benefits and demerits of garbage collection
- Unpredictability
- GC methods
- Escape analysis
- Reference counting
- Space reduction
- Cycles
- Atomic tasks
- GC in Java
- Understanding the current Parallel GC
- Generations
- Heap sizing
- Parallelism
- Why parallelism?
- The new G1 collector
- A brief history
- Impact on programming
- Deep insight on G1GC
- Comparing G1 collector to ParallelGC
- Common points
- The qualities of ParallelGC.
- The qualities of G1GC
- Concurrent mode failures
- Understanding memory errors
- Summary
- Chapter 6: Optimizing Code with Microbenchmarking
- The concept of microbenchmarking
- Microbenchmarks in Java
- Understanding the JMH
- Setting up the JMH
- Building up in the JMH
- Benchmark modes in the JMH
- Throughput measure
- Time-based measures
- Applying the JMH in Java projects
- What is Maven?
- Why use microbenchmarking?
- The challenges associated with microbenchmarks
- Wrong solutions from microbenchmarks
- Wrong component use
- Wrong hierarchy
- Wrong memory use
- Use of a specific environment
- The benefits of using the JMH
- Understanding the limitations of the JMH
- Summary
- Chapter 7: Speeding Up JSON Generation
- A transparent understanding of JSON in Java
- A brief history of JSON and examples
- Understanding JSON generation
- What is Javax.json?
- JSON object model
- JSON stream
- What are events?
- How does an event work?
- Types in JSON for object modeling
- Types in JSON for streaming API
- JSON trees
- Understanding the tree model
- Converting CSV to JSON
- Converting Excel to JSON
- Understanding value trees
- The benefits of using JSON
- Summary
- Chapter 8: Tools for Higher Productivity and Faster Application
- The JShell tool usage
- Creating a JShell session and setting context
- JShell commands
- Ahead-of-Time (AOT)
- Static versus dynamic compilation
- The AOT commands and procedures
- Summary
- Chapter 9: Multithreading and Reactive Programming
- Prerequisites
- Thread pools
- Monitoring threads
- Sizing thread pool executors
- Thread synchronization
- Tuning JVM
- Reactive programming
- Summary
- Chapter 10: Microservices
- Why microservices?
- Building microservices
- Container-less deployment
- Self-contained microservices
- In-container deployment
- Summary.
- Chapter 11: Making Use of New APIs to Improve Your Code
- Filtering streams
- Basic filtering
- Using other stream operations for filtering
- Stack-walking APIs
- Stack analysis before Java 9
- New better way to walk the stack
- Convenience factory methods for collections
- Why new factory methods?
- The new factory methods in action
- CompletableFuture in support of asynchronous processing
- The CompletableFuture API overview
- The CompletableFuture API enhancements in Java 9
- The problem and the solution using Future
- The solution with CompletableFuture
- Other useful features of CompletableFuture
- Stream API improvements
- Summary
- Index.