This is because most applications run in threads.
All POJO applications begin by calling the main method. In this simplest case, this method will do all the work by creating objects, calling methods, etc. Upon completion, the main JVM will close using the DestroyJavaVM thread, which waits for all non-daemon threads to complete before doing so. This is to ensure that all threads you create are executed before the JVM completes.
A GUI application, however, usually works as multiple threads. One for viewing system events, such as keyboard or mouse events. One to support windows and display, etc. The main method of this type of application will probably just start all the necessary threads and exit. It still creates the DestroyJavaVM thread, but now all it does is wait for all of your created threads to complete before the VM breaks.
As a result, any application that creates threads and relies solely on their functionality will always have a DestroyJavaVM thread waiting for its completion. Since all he does is join for all other running threads, he does not consume any resources.
source share