What does java "VM thread" do?

I use jstack to output stream information. And there is a thread: "VM Thread" prio = 10 tid = 0x0878b400 nid = 0x760a runnable

What is this thread used for? This takes up 50% of CPU usage and most of the processor time.

+4
source share
2 answers

I think this is the Garbage Collection. This is garbage collection.

+2
source

How do you know that this thread uses 50% of usage? Being controlled does not mean its consuming processor.

AFAIK it is used for the internal work of java, possibly involved in the GC.

What version of java are you using? I would check that you have an updated version of Java, and see if this all happens.

I would suggest a memory profile for your application to find out how many objects you create, and see if you can reduce the number of objects to reduce the load on the GC.

0
source

All Articles