`
- 浏览:
59506 次
- 性别:
- 来自:
深圳
-
The Principles of Java Application Performance Tuning
- To fully tune a Java application you need at least a basic level of understanding of: Hardware; OS processes; The JVM; Garbage collection; JIT compilation; Locks; Concurrency; Class loading; Object creation.
- One procedure for Java performance tuning is to repeatedly: Specify target performance; Specify the JVM configuration(s); Check that OS CPU, memory, and IO are acceptable, or tune; Check that response times are acceptable, or tune; Check that throughput is acceptable, or tune; After any change from tuning, start again from the beginning of this sequence.
- Throughput and response times often impact each other, tuning to optimize one frequently adversely affects the other, so you need to balance to get the overall best performance.
- Currently (around when 1.7.0_51 JVM is current), the concurrent collector is the best collector for low pause times in Oracle JVMs.
- Set the New area (young generation) size sufficiently large to hold all short-lived objects, so that they are collected before they get promoted to the old generation. But too large a New area size can cause longer pauses from copying live objects, so try to avoid oversizing this.
- Recommended JVM options for a webserver: -server -Xms -Xmx -XX:NewRatio: or -XX:NewSize= -XX:MaxNewSize= -XX:PermSize=256m -XX:MaxPermSize=256m -Xloggc: -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction= -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath= -XX:OnOutOfMemoryError= (stop or restart).
- If stop-the-world GC times are too long, tune the GC and use a profiler and/or heap dump to identify objects that can be eliminated.
- If CPU usage is low, analyse the concurrency behaviour using thread profilers or stack dumps to reduce wait times.
- If CPU usage is high, use a profiler to determine the execution bottlenecks and improve the algorithms.
- A tuning approach: first decide if tuning is even necessary; focus on the biggest bottleneck; much tuning is a balancing exercise so bear in mind that if you are improving one thing, you are probably making something else worse.
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
In iOS and macOS™ Performance Tuning, Marcel Weiher drills down to the code level to help you systematically optimize CPU, memory, I/O, graphics, and program responsiveness in any Objective-C, Cocoa,...
The Principles of Mathematics
The Principles of Object-Oriented JavaScript 1st Edition If you've used a more traditional object-oriented language, such as C++ or Java, JavaScript probably doesn't seem object-oriented at all. It ...
developer, integrator, or consultant, Performance Tuning for Linux Serverswill help you maximize the performance and value of every Linux system and application you run. © Copyright Pearson ...
The Principles Of Quantum Mechanics 被称为量子力学圣经
The Principles of Object Oriented.JavaScript
The Principles of Beautiful Web Design 2nd.pdf
Learn how Java principles and technology make the best use of modern hardware and operating systems Explore several performance tests and common anti-patterns that can vex your team Understand the ...
The Principles of Quantum Mechanics_4th_Dirac 狄拉克原子物理原理经典书籍
Expert Oracle RAC Performance Diagnostics and Tuning provides comprehensive coverage of the features, technology and principles for testing and tuning RAC databases. The book takes a deep look at ...
Multicarrier modulation techniques are rapidly moving from the textbook to the real world of modern communication systems
Principles of transaction processing Copyright © 2009 by Elsevier Inc. All rights reserved
The principles of beautiful web disign
Principles of Fluorescence Spectroscopy 3rd
The publication of Principles of Lithography, Third Edition just five years after the previous edition is evidence of the quickly changing and exciting nature of lithography as applied to the ...
But the core principles remain. I have made changes throughout the book: fixing problems, improving presentations, in some cases reordering material to improve the flow of ideas, and deleting a few ...
William L. Melvin 的著作, Principles of Modern Radar 第三部分, Radar Applications 仅供学习交流使用,请勿用于其他用途
The purpose behind The Principles of Programming is to provide the reader/student with a structured method to solve problems using a computer. Since the Principles book is language-independent (it ...
非常经典的量子力学教程,值得参考学习,内容包括最基础的数学部分,欢迎下载阅读。pdf版本!适合各个阶段的读者
In iOS and macOS™ Performance Tuning, Marcel Weiher drills down to the code level to help you systematically optimize CPU, memory, I/O, graphics, and program responsiveness in any Objective-C, Cocoa,...