Can we have an individual garbage collector in java?

As you know, java garbage collector is a low priority thread. And in java we can create any thread with high priority. Thus, it is possible to have your own custom garbage collector with variable priority (we can set it depending on the level of memory management).

Has anyone tried this. If so, can you share some knowledge about how and how its logic? Thanks

+2
source share
4 answers

The Java garbage collector is not a "low priority thread". For example, garbage collection often uses multiple threads in parallel. And, when memory does not work, garbage collection can crowd out any application stream.

I recommend that you review the Garbage Collection Configuration Guide to determine the type of garbage collector best suited to the application and how to configure its settings.

+10
source

The junk collection in Java has been finely tuned for many years. It is possible, but unlikely, that you are doing something special that has special needs in this area.

, , , , , , , - . :

  • .
  • .
  • .
  • .
+3

, , JVM, Java. , , Jikes RVM, Java ( IBM Open Source).

http://jikesrvm.org/

, :)

+2

I believe you will have to deploy your own JRE / JVM. Cannot disable default garbage collection in Java.

Java 7 is going to use a completely new GC, so you can simply replace it.

0
source

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


All Articles