I use jstack to output the thread info. And there is a thread: \"VM Thread\" prio=10 tid=0x0878b400 nid=0x760a runnable
What is this thread used to do? It takes 50%
The VM thread is defined here as:
This thread waits for operations to appear that require the JVM to reach a safe-point. The reason these operations have to happen on a separate thread is because they all require the JVM to be at a safe point where modifications to the heap can not occur. The type of operations performed by this thread are "stop-the-world" garbage collections, thread stack dumps, thread suspension and biased locking revocation.
There's also some information provided in a de-duplicated SO answer here.
How do you know that this thread is taking 50% usage? Being runnable doesn't mean its consuming cpu.
AFAIK this is used for internal java operation, possibly involved in GC.
Which version of java are you using? I would check you have an up to date version of Java and see if this still happens.
I would suggest you memory profile your application to see how much objects you are creating and see if you can reduce your object count to reduce any GC work load.
I think it is the Garbage Collection thread. It does Garbage Collection.