From f3ec0e3e1c08c214e02f3bbf72cac4f1d47bb13e Mon Sep 17 00:00:00 2001 From: Nikolay Martyanov Date: Thu, 16 Jan 2025 14:49:59 +0100 Subject: [PATCH] memory-monitor: Remove redundant allocations dump in handler. Exclude the memory allocation sites dump for zedbox as it is a heavy operation and the required memory usage information is already collected through pprof. The pprof data is more frequently used, making the allocation dump redundant. Signed-off-by: Nikolay Martyanov --- pkg/memory-monitor/Makefile | 1 - pkg/memory-monitor/README.md | 2 -- pkg/memory-monitor/src/monitor/memory-monitor-handler.sh | 5 ----- 3 files changed, 8 deletions(-) diff --git a/pkg/memory-monitor/Makefile b/pkg/memory-monitor/Makefile index 7d6f38ba3a..88980c6c90 100644 --- a/pkg/memory-monitor/Makefile +++ b/pkg/memory-monitor/Makefile @@ -99,7 +99,6 @@ local-clean-results-on-eve: ssh local_eve rm -rf /persist/memory-monitor/output/* local-analyze-results: - cat $(RESULTS_DIR)/*/allocations_pillar.out | cut -d";" -f3- | jq -r .msg | grep 'alloc' | awk '{bytes += $$2;} END {print "Total bytes allocated:", bytes, "bytes."}' go tool pprof -http=:8080 $(RESULTS_DIR)/zedbox $(RESULTS_DIR)/*/heap_pillar.out diff --git a/pkg/memory-monitor/README.md b/pkg/memory-monitor/README.md index a3a3227a3f..9191af6235 100644 --- a/pkg/memory-monitor/README.md +++ b/pkg/memory-monitor/README.md @@ -256,8 +256,6 @@ The output directory contains: * `event_info.txt`: A text file that contains metadata about the event. It includes the type of the event and the EVE version that was running when the event was triggered. - * `allocations_pillar.out`: A list of memory allocation sites of the zedbox - process. * `heap_pillar.out`: A heap dump of the zedbox process. It's collected using the built-in go tool. It's a binary file that can be analyzed using the `pprof` tool. How to analyze the heap dump is described in the next section. diff --git a/pkg/memory-monitor/src/monitor/memory-monitor-handler.sh b/pkg/memory-monitor/src/monitor/memory-monitor-handler.sh index e5eb3f67d9..927bd57c2f 100755 --- a/pkg/memory-monitor/src/monitor/memory-monitor-handler.sh +++ b/pkg/memory-monitor/src/monitor/memory-monitor-handler.sh @@ -243,11 +243,6 @@ show_pid_mem_usage "eve/services/pillar" "$sorted_pillar_processes" "$current_ou show_pid_mem_usage "eve" "$sorted_eve_processes" "$current_output_dir/memstat_eve.out" 1 -# ==== Dump memory allocation sites for Pillar ==== - -eve dump-memory -logread | grep logMemAllocationSites > "$current_output_dir/allocations_pillar.out" || : - eve http-debug stop # ==== Create a symlink to the current zedbox ====