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 ...
Tips October 2017
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 203 contents
https://www.youtube.com/watch?v=UykhZ36W04I
ThreadSanitizer and Heap Sampling (Page last updated August 2017, Added 2017-10-26, Author Jaeheon Yi, Jean Christophe Beyler, Publisher JVM Language Summit). Tips:
- Happens-before relationships and vector clocks let you identify race conditions.
- When looking for race conditions, bytecode rewriting would miss native and JNI locks, so you need to go to the native level
- Many data races are benign, but you need to analyse to determine that.
- A low overhead heap sampling profiler is feasible and has been proposed, JDK-8171119
https://kamilszymanski.github.io/controlling-parallelism-level-of-java-parallel-streams/
Controlling parallelism level of Java parallel streams (Page last updated October 2017, Added 2017-10-26, Author Kamil Szymanski, Publisher Under the hood). Tips:
- If you make your stream parallel by just adding .parallel() to the call chain, you cannot control the parallelism level in a programmatic way, in this case the parallel streams run on shared ForkJoinPool.commonPool().
- You can control the level of stream parallelism by moving a stream() into an explicit fork-join pool
new ForkJoinPool(N).submit(() -> stream()).get()
https://medium.com/@ramtop/weak-soft-and-phantom-references-in-java-and-why-they-matter-c04bfc9dc792
Weak Soft and Phantom references in Java and why they matter (Page last updated September 2017, Added 2017-10-26, Author Uberto Barbini, Publisher Medium). Tips:
- Soft references try to keep their reference for a while. Weak references don't try to keep the reference for long. Phantom references don't free the reference until cleared.
- PhantomReferences are intended to be used to be notified when some object goes out of scope to cleanup associated resources.
- When an object is garbage collected, any Reference object referring to that object is added to the reference queue used at construction of the Reference.
- Weak and Soft references are added to the Reference queue after the object is finalised, but Phantom references are added to the Reference queue before the object is finalised.
- SoftReferences can be used to implement a cache that can grow without risking OutOfMemoryErrors - store values wrapped inside a SoftReference, the values will be discarded under memory pressure OutOfMemoryError.
- If building SoftReference cache (typically has values wrapped inside a SoftReference), Brian Goetz suggests instead wrapping the whole cache in a SoftReference, ie the whole whole cache is dumped under memory pressure - any elements with hard references outside the cache in the main app will stay anyway, and this frees up a lot more memory quickly.
https://crossbrowsertesting.com/blog/test-automation/performance-testing-basics/
Everything You Need to Know About Performance Testing (Page last updated July 2017, Added 2017-10-26, Author Alex McPeak, Publisher SmartBear). Tips:
- Performance testing is used to measure responsiveness, stability, scalability, reliability, and speed.
- Checking an application's performance and ensuring consumers are experiencing acceptable load time and site speed is critical to high-quality software.
- Performance testing lets you predict traffic trends, allowing you to better prepare for spikes and site dropouts from future traffic.
- Load testing is used to make sure that software works as expected in ordinary circumstances; Stress testing challenges the limits of your application to see how much traffic it takes to slow down performance or break completely. In either case, you need to test for possible extraordinary spikes in demand.
- Numerous surveys and user behaviour monitoring analyses show that bad performance directly translates into business lost.
Jack Shirazi
Back to newsletter 203 contents
Last Updated: 2024-08-26
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/news/newtips203.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us