<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>Well, it *can* degrade system performance if it ends up being called very often.</div><div><br></div><div>There are basically two cases where explicitly calling erlang:garbage_collect() might be warranted:</div><div><br></div><div>- A process has performed some reasonably expansive operation, and will afterwards to basically nothing for a long time. This might happen in e.g. supervisors.</div><div><br></div><div>- After an expansive operation, where memory profiling has shown that it actually improves characteristics to force a garbage collect right there. The most likely benefit, if there is one, is that the old_heap is reduced.</div><div><br></div><div>Using explicit GCs should be seen as an optimization, pushing the garbage collector to work more aggressively than it otherwise would. As with all optimizations, you need to measure before and after to ensure that it actually _improves_ things, rather than make things worse.</div><div><br></div><div>BR,</div><div>Ulf W</div><br><div><div>On 13 Oct 2014, at 03:52, Akash Chowdhury <<a href="mailto:achowdhury918@gmail.com">achowdhury918@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Hi,</div><div>I have a question to experienced erlang developers/designers. Have you ever used or felt the need of using erlang:garbage_collect()? Or erlang's default garbage collection is good enough for all situations?</div><div>Erlang man page says that -"This function forces an immediate garbage collection of the currently executing process. 
The function should not be used, unless it has been noticed -- or there are good 
reasons to suspect -- that the spontaneous garbage collection will occur too 
late or not at all. Improper use may seriously degrade system performance."</div>
<div>Does using this seriously degrade system performance? Any one has experience of using this?</div><div>Thanks.</div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div><div>Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div><a href="http://feuerlabs.com">http://feuerlabs.com</a></div></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></body></html>