Java – performance degradation after moving to Jersey 2

We are using spring 4, embedded dock 9 and Sweatshirt servers Recently we moved to Jersey 2.13 and we found that the performance has decreased I used yourkit to do some research I see a huge CPU using reflection by the Jersey In addition, there are many nosuchmethodexceptions and classnotfoundexceptions in yourkit snapshot

Is there a kit configuration or best practice to avoid this problem or optimize the kit? Or maybe this is a known problem in Jersey 2?

The following are two screenshots of yourkit, showing the hotspots after excluding socket reading (Java. Net. Socketinputstream. Socketread0) The first is the combined Pendant:

And the second one:

thank you.

Solution

By looking at your question, I can't point out the exact problem But I can suggest you check the following:

>Check whether there are different versions of duplicate libraries / jars in the final build > check whether your final build recommends the spring / Jersey pass through dependency / jar version

If you use Maven to build a project, I recommend using the Maven dependency tree plug-in to check the above tips

– kiru

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>