Search code examples
garbage-collectionerlangcounter

Are counters garbage collected?


In the counters documentation I don't see any option to free a counter array. Can I assume they will be garbage collected or cleaned in some other way without my action?


Solution

  • According to the documentation they will be garbage collected as soon as no more process will reference them:

    Counters are not tied to the current process and are automatically garbage collected when they are no longer referenced.