开发者

Where do I start optimizing the JVM?

I'm kinda confused as to where to start looking to optimize my java-based application. Can someone give me some guidance as to what to look for?

Add note:

The java application I'm running is open source but I don't want to tweak 开发者_运维技巧it myself as I'm not capable of doing it. So what I'm looking at is on how to optimize the execution environment so as to fit the current behavior of the app. By the way, the application is hudson, a java-based continuous integration system.

Thanks in advance :)


Before start optimizing try to find out where you do you have a problem. Is your application CPU bound, memory-bound, or I/O bound? When you know this, try to find the biggest performance impact first and try to optimize it. Use Java profilers to find the problems in your application or configuration.

A good starting point for the whole process could be the Java Performance Tuning site.


Official Java Performance Documentation and Java SE Performance at a Glance


  • Read Java HotSpot VM options performance tuning.
  • Try unlock experimental VM options(-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:+UseFastAccessorMethods).
  • Optimizes the code.


Before you attempt to optimise the JVM, I suggest you optimise your code. You can use a profiler like VisualVM (free) or YourKit (commercial) to look at CPU and memory performance bottleneck. Often simple changes can make a big difference.

Conversely, you can change lots of JVM options and not be sure its really helped.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜