Java Performance Tuning
Java(TM) - see bottom of page
Our valued sponsors who help make this site possible
JProfiler: Get rid of your performance problems and memory leaks!
Training online: Concurrency, Threading, GC, Advanced Java and more ...
Java Performance Tuning
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
NEW: NOVEMBER 2024 NEWSLETTER
- We list all the latest Java performance related news and articles
- "Worst case virtual memory runs at *disk* speed"
- All the latest Java performance tips extracted in concise form
- "Avoiding waiting by: eliminating synchronization (eg partitioning the data per core and processing just on the core); use wait-free algorithms; keep the code in user-space (avoid kernel calls or bypass it if possible); avoid context-switching (use dedicated thread-to-core); use async/non-blocking IO; use busy polling; make shared data structures read-only; use single-producer+single-consumer queues to transfer between cores; use TCP_NODELAY; don't process requests as they come in from the network, take them off the queue and process separately so that longer latency requests don't block the queue"
OCTOBER 2024 NEWSLETTER
SEPTEMBER 2024 NEWSLETTER
AUGUST 2024 NEWSLETTER
JULY 2024 NEWSLETTER
- We list all the latest Java performance related news and articles
- "Tech is still growing and will for decades. Each type of deployment has it's niche ? use the tech that works best for your case and be prepared to look at all the alternatives, because we have more and more options available"
- All the latest Java performance tips extracted in concise form
- "Kubernetes pod CPU throttling happens each 100ms that the millicore budget is used, ie if in the first part of a 100ms window you use all your allocated millicore budget, the pod is not allocated any more CPU until the start of the next 100ms window. This CPU budget includes your application CPU usage as well as the JVM and GC CPU usage. The JVM uses Runtime.availableProcessors() to size the GC thread count and internal JVM thread pools, but this is an integer value, so millicores are rounded up to the next full core. This means the JVM can be expecting more CPU than is actually allocated, eg 1100 millicores would see the JVM decide it has 2 cores and allocate 2 threads to the GC which might cause too much CPU utilization by the GC and cause the application to be throttled. Using -XX:ActiveProcessorCount=N let's you explicitly tell the JVM how many cores it should use; it also let's you increase the thread pool sizes if that is beneficial."
JUNE 2024 NEWSLETTER
- We list all the latest Java performance related news and articles
- "In this case you may need entirely different styles of design and architecture for optimal performance on different systems, in a subsystem that you probably haven't considered needed that!"
- All the latest Java performance tips extracted in concise form
- "It is important to note that the -XX:MaxRAMPercentage does NOT constrain the total size of the memory the Java process can use. It specifically refers to the JVM heap size. The suggested procedure for setting container JVM memory is: 1. start with MaxRAMPercentage at 75%; 2. If your maximum heap usage stays high, you need to increase the container memory, but if the heap usage is okay but the process size is close to the container limit, you need to decrease MaxRAMPercentage (or give more containermemory)"
MAY 2024 NEWSLETTER
APRIL 2024 NEWSLETTER
- We list all the latest Java performance related news and articles
- "A very different style of GC tuning requiring specialized tuning skills, applied across large numbers of JVMs - but with direct measurable cost benefits"
- All the latest Java performance tips extracted in concise form
- "Strategies for preventing memory leaks include: Ensure that objects are in scope only as long as they are needed; Use static fields cautiously; Avoid static collections that grow indefinitely; Always unregister listeners and callbacks when they are no longer needed; Limit the size of caches; Remove objects from collections when they are no longer needed; Be cautious with inner class instances; Always close resources (eg files, streams, connections) after use; profile your application memory usage; Unit and integration test to check for memory leaks"
MARCH 2024 NEWSLETTER
FEBRUARY 2024 NEWSLETTER
JANUARY 2024 NEWSLETTER
- We list all the latest Java performance related news and articles
- "For concurrent updates Hashtable.size() is strictly consistent, ConcurrentHashMap.size() is eventually consistent"
- All the latest Java performance tips extracted in concise form
- "Because garbage collection costs across an entire organization is hugely significant and garbage collection cost tends to be dominated by memory requirements and pressure, memory profiling and tuning actually reduces costs across the board as reduced memory pressure translates directly to reduced garbage collection which translates directly to reduced CPU! A lot of high-performance Java dev have become experts at avoiding allocations altogether for exactly this reason"
DECEMBER 2023 NEWSLETTER
- We list all the latest Java performance related news and articles
- "Eventual consistency has become the more popular mechanism because of the lower latency of data access"
- All the latest Java performance tips extracted in concise form
- "Selecting the right garbage collector is crucial for optimizing application performance: Serial GC for small applications with low memory footprint and low CPU requirements, but not suitable for low-latency applications due to longer GC pauses; Parallel GC (Throughput Collector) for maximizing application throughput by utilizing multiple threads for garbage collection but also not suitable for low-latency applications due to significant GC pauses; CMS (Concurrent Mark Sweep) designed to minimize pause times by working concurrently with application threads, has lower pause times but suffers from fragmentation ultimately giving long pauses; G1 (Garbage-First Collector) tries to provide a good balance between throughput and pause times, but doesn't give the lowest pause times; ZGC (Z Garbage Collector) and Shenandoah designed for low-latency applications, aiming to achieve pause times of less than 10ms, even on large heaps"
NOVEMBER 2023 NEWSLETTER
- We list all the latest Java performance related news and articles
- "The full process data structure of the JVM is dramatically different depending on which GC algorithm is chosen"
- All the latest Java performance tips extracted in concise form
- "Common cache invalidation algorithms: Time-based after a certain period of time; Version-based whenever version changes; Delta-based - compare the current version with the latest version and invalidate if the delta between the two exceeds a certain threshold; Least Recently Used (LRU) - the item not accessed for the longest time is evicted from the cache; Least Frequently Used (LFU) - the item accessed the least is evicted from the cache. Of course caches can combine multiple algorithms"
OCTOBER 2023 NEWSLETTER
- We list all the latest Java performance related news and articles
- "Most JVM tuning changes needed in production are garbage collection related changes"
- All the latest Java performance tips extracted in concise form
- "Testing gotchas: testing once is jittery and un-representative, interpreted code behaves very differently from compiled JIT optimized code, System.currentTimeMillis() can go backwards (eg from NTP), JVM code and branch elimination can give unrepresentative performance for unrepresentative data and workloads, testing on different platforms can give very different (unrepresentative) results, power saving modes can give unrepresentative results, having other processes running at the same time can give unrepresentative results."
SEPTEMBER 2023 NEWSLETTER
AUGUST 2023 NEWSLETTER
JULY 2023 NEWSLETTER
JUNE 2023 NEWSLETTER
MAY 2023 NEWSLETTER
APRIL 2023 NEWSLETTER
MARCH 2023 NEWSLETTER
- We list all the latest Java performance related news and articles
- "The new 4GLs aren't new languages, they are 3GLs together with intelligent IDEs"
- All the latest Java performance tips extracted in concise form
- "Strategies to prevent deadlocks: always acquire locks in a fixed order; avoid holding locks for extended periods; reduce the scope of the lock holding code block; use ReentrantLock and similar concurrent lock classes to manage locks, eg using tryLock() to acquire locks without blocking; use timeouts when acquiring locks to prevent threads from waiting indefinitely; use non-blocking algorithms and data structures to avoid deadlocks altogether"
FEBRUARY 2023 NEWSLETTER
JANUARY 2023 NEWSLETTER
Previous newsletters
All our previous newsletters can be viewed from here
How to use this site
This site has four main information resources:
- The uncategorized tips page lists many other web pages with Java performance tuning related information. Each web page has its performance tuning tips extracted and listed immediately after the URL is listed. These tips are being categorized, and the tips page links to those categories currently available. If the performance area you are interested in is not yet categorized, send us an email from this page telling us the categorization you'd like to see. In any of the tips pages, use your browser's "find" or "search" option to identify particular tips you are interested in on the page, and follow up by reading the referenced web page if necessary or desired.
- The resources page lists Java performance tuning resources including books, tools, reports, other performance tuning sites of interest, and Java performance tuning discussion groups.
- The news pages are monthly newsletters listing any new Java performance tuning related information, together with Kirk Pepperdine's discussion group roundup and Javva The Hutt.
- The tool reports pages are detailed introductory
reports on various Java performance related tools, for both free and commercial tools.
This site has been designed to download almost as fast as possible.
(Some stylistic markup and required server-side processing has been used in
preference to absolute speed contraints.)
The web tree contains very few graphics and almost no complex typesetting markup
except for very simple tables, and the main pages can be accessed directly from
the menu.
This line is only to help search engines: Java performance tuning Java tuning Java optimization
Java optimize Java optimizing Java fast Java faster Java speedup Java performance Java High-Performance
Last Updated: 2024-11-29
Copyright © 2000-2024 Fasterj.com. All Rights Reserved.
All trademarks and registered trademarks appearing on JavaPerformanceTuning.com are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. JavaPerformanceTuning.com is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
URL: http://www.JavaPerformanceTuning.com/index.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us