Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(nvstreammux): free legacy latency list nodes - #148

Open
nv-support wants to merge 1 commit into
NVIDIA:developfrom
nv-support:fix/nvstreammux-latency-list-leak
Open

nv-support wants to merge 1 commit into
NVIDIA:developfrom
nv-support:fix/nvstreammux-latency-list-leak

Conversation

@nv-support

@nv-support nv-support commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Legacy nvstreammux leaks one GList node (24 B, a 32 B malloc chunk) per frame when latency measurement is enabled (NVDS_ENABLE_LATENCY_MEASUREMENT or NVDS_LATENCY_MEASUREMENT_SILENT).

mux->latency_metadata_list gets one g_list_append per frame. Before each batch is pushed, the nodes are detached with g_list_remove_link() and never freed. The fix replaces that loop with g_list_free(). Only the list nodes are owned by the mux. The NvDsMetaCompLatency data is still released with the batch meta through nvds_release_latency_meta, so behavior is unchanged.

Reported on the forum: https://forums.developer.nvidia.com/t/389861. The reporter measured ~2.8 MiB/h with one 1080p 24 fps source. New nvstreammux is not affected because it does not keep this list.

Validation

Tested commit: 2ee6e9c (based on develop cf9e610).

Build: x86, 2x NVIDIA A40, driver 620.70.06, nvcr.io/nvidia/tritonserver:26.10-py3 container (CUDA 13.4, TensorRT 11.4.0.106, VPI 4.1.4, NVDS 9.2.1). bash ./build/build.sh --package completed successfully in 25 min. It produced deepstream-9.2_9.2.1-1_amd64.deb and deepstream_sdk_v9.2.1_x86_64.tbz2 and installed to /opt/nvidia/deepstream/deepstream-9.2. The installed libnvdsgst_multistream.so and deepstream-app match the build output.

source4 sanity test: source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display.txt, run with the newly built deepstream-app. All 4 sources ran at 30 fps (sync=1) until EOS. Run time 125 s, App run successful, no errors. The run needed three setup changes that are unrelated to this PR:

  • Sample models were prepared with tools/modelopt/prepare_samples.py, as tools/modelopt/README.md requires for TensorRT 11.
  • int8-calib-file was commented out in the three sample config_infer_*.txt copies. The TRT 11 nvinfer rejects it even with network-mode=2.
  • The container has no display, so sink0 was set to fakesink and sink1 (file) was enabled.

Leak test: reporter's pipeline (nvurisrcbin RTSP 1080p24 -> legacy nvstreammux batch-size=1 live-source=1 -> fakesink) with NVDS_ENABLE_LATENCY_MEASUREMENT=1. The patched and unpatched (cf9e610) builds ran side by side for 30 min.

  • A40, patched: RSS flat over the last 15 min (0 kB).
  • A40, unpatched: RSS grew +676 kB over the last 15 min, ~2.64 MiB/h (= 24 fps x 32 B).
  • AGX Orin, L4T R39.2, DS 9.1 container: same pipeline for 30 min. RSS flat with latency measurement off. With it on, RSS grew 2.75 MiB/h.

Not tested: the Jetson package build.

Checklist

  • My working branch is based on NVIDIA/DeepStream:develop.
  • The PR targets NVIDIA/DeepStream:develop.
  • bash ./build/build.sh --package completed successfully.
  • The source4 sanity test passed with the newly built deepstream-app on x86 or Jetson.
  • The PR records the tested platform, software version, commit, source4 configuration, test duration, and results.
  • Additional tests relevant to the change passed, where applicable.
  • My submitted commits include contributor sign-off.
  • Affected documentation is updated, where applicable. (No documentation is affected.)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: junshengy <junshengy@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant