ponylang / ponyc

Pony is an open-source, actor-model, capabilities-secure, high performance programming language
http://www.ponylang.io
BSD 2-Clause "Simplified" License
5.73k stars 415 forks source link

Fix heap chunk recycling memory leak and another bug #4535

Closed dipinhora closed 3 weeks ago

dipinhora commented 3 weeks ago

The implementation of actor heap chunk recycling from #4531 had two bugs. First, the large heap re-use logic (which was temporarily disabled in #4534) had a bug related to how it updated the large chunk recyclable list pointer in the heap. Second, the memory clearing logic in the ponyint_heap_endgc function was clearing more of the heap than it should have been resulting in a memory leak for both small and large chunk recyclable chunks.

This commit re-enabled large chunk recycling (undoing #4534) and fixes both bugs so that both large chunk and small chunk recycling work as expected without memory leaks.

SeanTAllen commented 3 weeks ago

Everything ran properly last night @dipinhora