Hello Folks, As everybody know that gc is low priority thread which will be running in JVM in order to track the memory(i mean release the memory for unreferrenced objects).Can we set the priority for gc?I mean highest priority for GC such that it will run for release of memory resources? Regards, Ravi
i am not sure weather we can set default gc thread�s priority or not. but u can use System.gc() for garbage collection or can create a thread with System.gc() statement and set priority of that thread.
Hi, Your basic assumption -- that "GC is a low-priority thread", and that changing the priority would "improve" GC in some way -- is flawed. No such thing is guaranteed or even true in general. The details of how GC works are implementation-specific and vary over time and across vendors. Now, if you're interested in tuning the GC performance of HotSpot, there is a lot of material available. In particular, see this document. But it's not something you do by trying to fiddle with the priority of "the GC thread."