`
- 浏览:
61331 次
- 性别:
- 来自:
深圳
-
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
相关推荐
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 ...
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 ...
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 ...
本书《Database_Tuning___Principles_Experiments_and_Troubleshooting_Techniques》(数据库性能调优:原理与技术)旨在为读者提供全面的指导,帮助他们了解数据库调优的基本原则,并通过实际案例学习有效的故障...
6. **Advanced Topics**: The book also covers advanced topics such as security, performance tuning, and integrating OSGi with other technologies. #### Practical Applications of OSGi OSGi is widely ...
This approach not only teaches readers how to solve specific problems but also imparts a deeper understanding of the underlying principles and concepts. #### Content Overview 1. **Statistical ...
The Way to Go,: A Thorough Introduction to the Go Programming Language 英文书籍,已Cross the wall,从Google获得书中源代码,分享一下。喜欢请购买正版。 目录如下: Contents Preface......................
1.2.3 Targets of the language....................................................................................5 1.2.4 Guiding design principles........................................................
18 Performance Tuning RMAN Backup and Recovery Operations . . . . . . . . . . . . . . 445 PART IV RMAN in the Oracle Ecosystem 19 Duplication: Cloning the Target Database . . . . . . . . . . . . . . ....