Skip to content
  • jim warner's avatar
    top: finally circumvent that minor libnuma memory leak · 18b1a887
    jim warner authored
    
    
    Still unhappy with a minor memory leak associated with
    libnuma, I experimented with omitting the dlclose that
    was issued at module's end. For some reason which will
    remain a mystery, the valgrind leak then went bye-bye.
    
    So this patch just omits one use of dlclose and relies
    on whatever kernel magic is at work to free the memory
    when each process ends. We kept, however, the original
    code (now commented-out) to serve as a future caution.
    
    There remains one potential (but unlikely) dlclose use
    near the original dlopen. But there will be no leak as
    that 'numa_node_of_cpu' will not yet have been called.
    This seems to be the culprit that triggers such leaks.
    
    None of this libnuma shit would likely have come close
    to hitting our fan had the numa developers provided us
    with 'new' and 'unref' functions like our newlib does.
    
    [ this commit parallels a patch in our newlib branch ]
    
    Signed-off-by: default avatarJim Warner <james.warner@comcast.net>
    18b1a887
To find the state of this project's repository at the time of any of these versions, check out the tags.