Junior — Middle
Ce număr de fire sunt create la pornirea unei aplicații JVM?
sobes.tech AI
Răspuns de la AI
Launched a JVM application creates several threads by default, among which the main ones are:
- main — the main thread in which your application's
mainmethod runs. - GC (Garbage Collector) threads — responsible for garbage collection.
- Finalizer Thread — thread for executing
finalizemethods. - Reference Handler Thread — processes weak, soft, and phantom references.
- Signal Dispatcher — handles OS signals.
The exact number of threads depends on the JVM implementation and settings, but usually, there are about 5 to 10 threads immediately after startup. Additional threads are created as needed, for example, for thread pools, asynchronous tasks, etc.