From: Eric Wong Date: 2018-06-08T20:06:12+00:00 Subject: [ruby-core:87461] Re: [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase naruse@airemix.jp wrote: > I once get a thought, instead of counting memory Ruby itself bundling jemalloc and use jemalloc's memory profiler. > jemalloc counting allocated bytes inside it. > If Ruby accesses it, Ruby can avoid to execute extra atomic instructions. Right. Ideally, we won't have to count malloc bytes at all. What I would prefer is malloc could allow executing hooks before it calls sbrk/mmap to get more memory from the kernel: That would be the ideal time for us to GC. Unsubscribe: