This is a system thread; see What does java "VM thread" do? If it is consuming a lot of time, it probably means that your JVM is doing a lot of "stop the world" garbage collecting.
If your JVM is spending a lot of time garbage collecting, that typically means that your heap is close to full and you are getting close to the point where you will get an OutOfMemoryError
failure.
There are two possible causes for this kind of thing:
- Your heap is too small for the computation you are trying to perform.
- Your application has a memory leak.
In the former case, you can either increase the heap size, or reduce the problem size, or modify the application to use memory more efficiently. Note that if you keep increasing the heap size, you will eventually have to worry if you have enough address space and physical RAM in your machine.
In the latter case, you need to find and fix the bug or bugs on your application that are causing the memory leak. There are lots of articles on finding and fixing Java memory leaks.