Files
milvus/cmd
Jamesandxiaofanluan f4ae66a2fd enhance: add startup flag for existing native profiling (#53997)
Milvus already provides jemalloc native heap profiling and
`/debug/jemalloc/pprof/heap`. This PR only adds an opt-in startup flag,
using the existing subprocess path so jemalloc receives its
configuration before allocator initialization.

```sh
milvus run querynode --native-profile
curl -f http://localhost:9091/debug/jemalloc/pprof/heap -o native.heap
```

The flag enables profiling and allocation sampling while preserving
other `MALLOC_CONF` options, including the sampling interval. Existing
builds, HTTP routing, dump behavior, and dependencies are reused. The
legacy HTTP endpoint requires a Linux `with_jemalloc` build with
profiling support and remains subject to existing pprof/management
routing; enabling management authentication hides legacy DefaultServeMux
routes.

Fixes #53985

Validation: focused CLI tests and Go vet passed; the startup-only
revision also passed a Linux `go build -mod=readonly -tags
dynamic,with_jemalloc ./cmd` and gosec on `cmd/milvus`. Formatting and
diff checks passed. No service or profiling workload was started.

Signed-off-by: xiaofanluan <[email protected]>
Co-authored-by: xiaofanluan <[email protected]>
2026-10-09 23:04:42 +08:00
..
2021-11-16 15:41:11 +08:00