Support Questions
Find answers, ask questions, and share your expertise

Is it possible to manually run garbage collection?

Is it possible to manually run garbage collection?

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

Re: Is it possible to manually run garbage collection?

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