multithreading - Why is Java using more cores than I asked it to? -
I have a lot of java code I know that I am creating three threads. I have six cores, so I hope my CPU usage will increase from 0% to 50%. However, after adding some new, memory-intensive operations, I'm looking at CPU usage up to 100% - using all six cores of my machine.
What's going on here? Is this a garbage collector at work?
Due to its many long running threads, you must first have threads that have been running for a long time. Find out.
You can easily take the thread dump.
ps -fL will give you a list and check for LWP for time. After this walk, give it a hexadecimal value of the long lasting thread.
The above is PID Java process ID.
Hope this will help you solve the problem.
Comments
Post a Comment