Performance Cost of Profiling a Web-Application in Production

后端 未结 5 826
野性不改
野性不改 2021-01-30 15:20

I am attempting to solve performance issues with a large and complex tomcat java web application. The biggest issue at the moment is that, from time to time, the memory usage sp

5条回答
  •  Happy的楠姐
    2021-01-30 15:36

    You may also consider using one of the modern HotSpot JVM - Java Flight Recorder and Java Mission Control. It is a set of tools that allow you to collect low-level runtime information with the CPU overhead about 5% (I cannot prove the last statement anyhow, this is the statement of Oracle engineer who presented the feature and live demo).

    You can use this tool as long as your application is running 1_7u40 JVM or higher. To enable the runtime info collection, you need to start JVM with particular flags:

    By default, JFR is disabled in the JVM. To enable JFR, you must launch your Java application with the -XX:+FlightRecorder option. Because JFR is a commercial feature, available only in the commercial packages based on Java Platform, Standard Edition (Oracle Java SE Advanced and Oracle Java SE Suite), you also have to enable commercial features using the -XX:+UnlockCommercialFeatures options.

    (Quoted http://docs.oracle.com/javase/8/docs/technotes/guides/jfr/about.html#sthref7)

    I added this answer as this is viable option for profiling in production IMO.

    Also there is an Eclipse plugin that supports JFR and JMC and capable of displaying information user-friendly.

提交回复
热议问题