Skip to content

memory leak in retained #2838

Open
Open

Description

@MrqiangBig

OS: Linux node1 5.10.0-136.12.0.86.4.nos1.x86_64 #11 SMP Thu Jan 16 11:24:51 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Jemalloc Version:5.3.0 release

At begin,my process have 41.4G RSS and 203G VSS,malloc_stats_print show mmaped and retained is : mapped: 31396716544, retained: 116263231488(other 64G is hugepage and 174 thread * 8M+ stackaddr mmap),the records are as follows:

Image

One day later,the RSS increased,and my process trim some memory,the RSS and VSS change to (40.6g, 208.0g), and mmaped and retained change to (16855392256 ,136137613312),the records are as follows:

Image

At this time, I use gcore to generate a core, use gdb traverse all retained memory, the zero and commit flag is true,and all retained memory is 0. The total muzzy ecache is zero.

So I think purge is work(MADV_DONTNEED is work),but the RSS is not match with mapped,I think this is memory leak .

How should I continue to analyze this problem(OS problem or jemalloc problem)? or there is any fixed issue?

Activity

  1. wanghaao commented on Apr 23, 2025

    @wanghaao

    I also found it! Maybe it's a bug.

    ref: https://jemalloc.net/jemalloc.3.html#opt.retain

    for [64-bit] Linux, which has a quirk in its virtual memory allocation algorithm that causes semi-permanent VM map holes under normal jemalloc operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions