Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we have a customized Garbage collector in java?

As we know the java's garbage collector is a low priority thread. And in java we can create any thread with high priority. So is it possible to have our own customized garbage collector thread with variable priority (we can set depending on the level of memory management).

Did anybody tried that. If yes can you share some knowledge about how and its logic? Thanks

like image 307
GuruKulki Avatar asked Oct 16 '25 00:10

GuruKulki


1 Answers

Java's garbage collector isn't "a low priority thread." For example, garbage collection often uses multiple threads in parallel. And, when memory runs low, garbage collection can preempt any application thread.

I recommend studying the Garbage Collection Tuning guide to determine the type of garbage collector best suited to an application, and how to adjust its parameters.

like image 191
erickson Avatar answered Oct 18 '25 15:10

erickson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!