Can we increase the priority of the garbage collection thread in java

As we know in java, we have priority levels for threads, and the garbage collector is the thread with the lowest priority. So I wanted to know if we can have a Garbage collector for a particular java application so that it is more priority so that it can increase memory management for this application.

+2
source share
3 answers

There are many command line switches that define the garbage collection behavior in the Sun JVM.

This is a bit complicated, but they are described here: http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

+3
source

, , , , , JVM.

, . , .

+2

, . , java 10 , (, Solaris, 170 ), . , Windows NT . .

For more info see this SO question

Depending on the JVM implementation, higher priority threads may still exaggerate lower priority threads in a time reduction scheme. Adding a timeline mixes processing between threads of the same priority; on a multiprocessor machine, threads can start simultaneously. Unfortunately, this feature can lead to differences in the behavior of your application.

+1
source

Source: https://habr.com/ru/post/1729953/


All Articles