Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Is it possible to manually run garbage collection?

avatar
Contributor

Hi experts,

In one of our clusters, the datanode heap is currently at 70% and our warning thresholds are 80% and Error at 90%.

I was wondering if its possible to manually initiate a garbage collection to see if the heap memory goes down.

I checked the logs and it seems like the garbage collection got initiated right after our alert, so probably when the heap got up to about 80-90%.

 

Any suggestions on how to properly monitor this alert or configuration recommendations?

 

Thanks,

1 REPLY 1

avatar
Expert Contributor

Hi @ryu ,

 

We can trigger manual GC in datanode JVM application AFAIK.  The best way to deal with long GC pauses is to allocate right amount of heap memory. 

We recommend the formula of - 1gb heap per 1 million blocks. You can get the number of block count from NameNode Webui -> datanode (through ambari or CM).

Increase the heap and that should fix your issue. 

Do check for "No GC detected" in Datanode logs, if you see those then it could be hardware problem triggering GC.

 

Does that answers your questions. Let me know

 

Regards,
Vipin