Object pool memory leak detection in proxyd (7.6.3)
FortiWeb now enhances memory management in proxyd by introducing object pool memory leak detection. Object pools, used for efficient memory allocation and release, contain fixed-size chunks for various proxy operations, including packet handling, session tracking, and connection management.
To identify potential memory leaks, FortiWeb adds a timestamp field to object pool nodes. This timestamp is recorded when a node is allocated, allowing proxyd to track node lifespan. A diagnostic function inspects active nodes and identifies those that persist for more than a specified duration (default: 30 minutes). A continuous increase in long-lived nodes signals a potential memory leak.
Key Enhancements:
-
New timestamp field in object pool nodes for lifespan tracking.
-
Enhanced debugging tool via
diagnose debug jemalloc proxyd pdump-leaksto analyze memory retention. -
Structured log output to
/var/log/gui_upload/proxyd-objpool-*.txt, detailing object pools and aged nodes. -
Configurable time threshold for detecting potential leaks (default: 30 minutes, adjustable via CLI).
Example CLI Usage:
diagnose debug jemalloc proxyd pdump-leaks <minutes>
If <minutes> is omitted, the default threshold of 30 minutes is used.
Sample Log Output:
worker_run-1-session_t: Total age > 2 min: 1 worker_run-1-connection_t: Total age > 2 min: 2 worker_run-1-pt_stream_t: Total age > 2 min: 2 worker_run-0-packet_t: Total age > 2 min: 0