Where does the growing CPU load come from?

I have problems with the application that I developed. When I run it for a long period of time, the CPU load is slow. Here is a screenshot of Java VisualVM after 45 minutes.

enter image description here

As you can see, the memory usage is very constant and the number of threads. The application opens the LAN jack and measures every 2 seconds. This measurement is performed in a separate thread (which can be seen at the bottom of the thread).

CPU usage is slowly but surely increasing, but during the night it builds up to 70-80%, and at this point the whole system slows down noticeably (obviously). Now I do not want this increase in rate, but I can not find the reason for this. There is no memory leak (which will also lead to a continuous increase in memory), and I will not create more and more threads (because this number is also stable).

My application has an extensive graphical interface and several threads. Here is a list of threads from the profiler:

enter image description here

I marked "my" threads in yellow. Therefore, MeasurementCommunication.startMeasurement threads are created (and terminated again) when necessary. So at any moment there is only one of these guys.

So, to shorten the long story: I don't know where this increase in CPU comes from. Do you have ideas? Maybe a common Java problem? If you need more information or details, just tell me and I will try to answer them.;)

+4
source share
1 answer

Just by looking at your used heap, it appears from 5:00 p.m. to go up, what you need to do is grab it for a longer period and ensure that it comes back down and continues up / down, but usually flat use if it starts to produce results, such as steps, i.e. increase farther and farther up, then it could be a memory leak causing a problem that then affects your processor. so briefly you need to watch it longer, especially when the pile rises. So, the state between each complete garbage collection ....

+3
source

All Articles