You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there anyway to trace the fragmentation? In my application, only 8GB memory used (we record each malloc/free to count the total memory not released), but the process totally used 58GB memory (from RSS) and the "stats.mapped" shows totally 58GB. We think it may be caused by jemalloc cache, but how to trace the fragmentation source? Which memory using pattern causes this problem maybe?
You can use malloc_stats_print to check Jemalloc memory statistics.
We have tried but the report does not works because it only shows the bins or extents allocation information, without the fragmentation info. Or is there anything we missed in the report which releasted to the fragmentation address?
You can use malloc_stats_print to check Jemalloc memory statistics.
We have tried but the report does not works because it only shows the bins or extents allocation information, without the fragmentation info. Or is there anything we missed in the report which releasted to the fragmentation address?
You can pay attention to the two fields:
(1)stats.active
(2)stats.allocated
The difference between stats.active and stats.allocated is essentially the memory fragmentation.
You can also pay attention to the util field of the bin.It represents the memory utilization rate of this bin.
You can use malloc_stats_print to check Jemalloc memory statistics.
We have tried but the report does not works because it only shows the bins or extents allocation information, without the fragmentation info. Or is there anything we missed in the report which releasted to the fragmentation address?
You can pay attention to the two fields: (1)stats.active (2)stats.allocated The difference between stats.active and stats.allocated is essentially the memory fragmentation.
You can also pay attention to the util field of the bin.It represents the memory utilization rate of this bin.
Thanks for reply.
Below is the first util info in state report, is the rate means much low utilization of bin? Is this related to the process memory fragmentation? And can I say a small memory is held by process thus most larger memory is held by jemalloc due to this fragmentation, the total extent will not be released to os until process memory freed?
Activity
ylw510 commentedon May 21, 2025
You can use
malloc_stats_printto check Jemalloc memory statistics.ChrisZcu commentedon May 21, 2025
We have tried but the report does not works because it only shows the bins or extents allocation information, without the fragmentation info. Or is there anything we missed in the report which releasted to the fragmentation address?
ylw510 commentedon May 21, 2025
You can pay attention to the two fields:
(1)
stats.active(2)
stats.allocatedThe difference between
stats.activeandstats.allocatedis essentially the memory fragmentation.You can also pay attention to the
utilfield of thebin.It represents the memory utilization rate of thisbin.ChrisZcu commentedon May 22, 2025
Thanks for reply.
Below is the first util info in state report, is the rate means much low utilization of bin? Is this related to the process memory fragmentation? And can I say a small memory is held by process thus most larger memory is held by jemalloc due to this fragmentation, the total extent will not be released to os until process memory freed?
Extend system.jemalloc_bins for internal fragmentation introspection