Performance Cost of Profiling a Web-Application in Production

后端 未结 5 788
野性不改
野性不改 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条回答
  •  滥情空心
    2021-01-30 15:54

    There is nothing wrong in profiling production apps. If you work on distributed applications, there are times when a outofmemory exception occurs in a very unique probability scenario which is very difficult to reproduce in a dev/stage/uat environment.

    You can try using custom profilers but if you are in a hurry and plugging in/ setting upa profiler on a production box will take time, you can also use the jvm to take a memory dump(jvms memory dump also gives you thread dump)

    1. You can activate the automatic generation on the JVM command line, by using the following option : -XX:+HeapDumpOnOutOfMemoryError

    2. he Eclipse Memory Analyzer project has a very powerful feature called “group by value”, which makes it possible to build an object query and regroup the instances by a field value. This is useful in the case where you have a lot of instances that are containing a smaller set of possible values, and you can to see which values are being used the most. This has really helped me understand some complex memory dumps so I recommend you try it out.

提交回复
热议问题