From: Eric Wong Date: 2018-05-18T08:47:34+00:00 Subject: [ruby-core:87166] Re: [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase Eric Wong wrote: > OK. Also, did we ever consider signed type (`ssize_t`) for malloc > counters instead? This may be more useful if we switch to > thread-local storage for counters to avoid atomics. Reverted for now because of regressions in: bm_array_sample_100k__6k bm_array_sample_100k___10k bm_array_sample_100k___50k I think the original unsigned + underflow avoidance code prevented us from accounting free() properly, and we were triggering GC more as a result. With this patch, frees are accounted properly so malloc_increase grew too slowly... Also, I think it would be beneficial to check malloc_increase and do a lazy sweep step BEFORE calling malloc, since that should improve cache locality in malloc (because they're usually LIFO). Unsubscribe: