[HN Gopher] Poireau: A Sampling Allocation Debugger
       ___________________________________________________________________
        
       Poireau: A Sampling Allocation Debugger
        
       Author : luu
       Score  : 7 points
       Date   : 2025-05-19 02:11 UTC (3 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | PuercoPop wrote:
       | Recently saw this through
       | https://discuss.systems/@pkhuong/114532017716618023 which
       | summaries why this would be useful:
       | 
       | > Flagging old live (i.e., potentially immortal) allocations is
       | easier (https://github.com/backtrace-labs/poireau) and more
       | closely matches the goal of identifying why the heap grows
       | instead of entering a steady state.
       | 
       | Ej. Why is Sidekiq memory consumption growing over time.
        
       | itamarst wrote:
       | One key question in these sort of things is how free() works: it
       | is given a pointer, and it has to decide whether this was sampled
       | or not, with _minimum_ effort.
       | 
       | Poireau does this, IIRC, by putting the pointers it sampled in a
       | different memory address.
       | 
       | Sciagraph (https://sciagraph.com), a profiler I created, uses
       | allocation size. If an allocation is chosen for sampling the
       | profiler makes sure its size is at least 16KiB. Then free() will
       | assume that any allocation 16KiB or larger is sampled. This may
       | not be true, it might be false positive, but it means you don't
       | have to do anything beyond malloc_usable_size() if you have
       | free() on lots and lots of small allocations. A previous
       | iteration used alignment as a heuristic, so that's another
       | option.
        
       ___________________________________________________________________
       (page generated 2025-05-22 23:01 UTC)