diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vlib/cli.c | 2 | ||||
-rw-r--r-- | src/vppinfra/mem_dlmalloc.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c index 9c53200f8cf..5dd25980c8c 100644 --- a/src/vlib/cli.c +++ b/src/vlib/cli.c @@ -981,7 +981,7 @@ show_memory_usage (vlib_main_t * vm, VLIB_CLI_COMMAND (show_memory_usage_command, static) = { .path = "show memory", .short_help = "show memory [api-segment][stats-segment][verbose]\n" - " [numa-heaps][map]", + " [numa-heaps][map][main-heap]", .function = show_memory_usage, }; /* *INDENT-ON* */ diff --git a/src/vppinfra/mem_dlmalloc.c b/src/vppinfra/mem_dlmalloc.c index 25014c8ec78..59c7b7c2aa9 100644 --- a/src/vppinfra/mem_dlmalloc.c +++ b/src/vppinfra/mem_dlmalloc.c @@ -355,6 +355,7 @@ format_mheap_trace (u8 * s, va_list * va) int verbose = va_arg (*va, int); int have_traces = 0; int i; + int n = 0; clib_spinlock_lock (&tm->lock); if (vec_len (tm->traces) > 0 && @@ -381,9 +382,10 @@ format_mheap_trace (u8 * s, va_list * va) total_objects_traced += t->n_allocations; - /* When not verbose only report allocations of more than 1k. */ - if (!verbose && t->n_bytes < 1024) + /* When not verbose only report the 50 biggest allocations */ + if (!verbose && n >= 50) continue; + n++; if (t == traces_copy) s = format (s, "%=9s%=9s %=10s Traceback\n", "Bytes", "Count", |