Repository navigation
fix(nvstreammux): free legacy latency list nodes - #148
Open
nv-support wants to merge 1 commit into
Open
nv-support wants to merge 1 commit into
nv-support wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: junshengy <junshengy@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Legacy
nvstreammuxleaks oneGListnode (24 B, a 32 B malloc chunk) per frame when latency measurement is enabled (NVDS_ENABLE_LATENCY_MEASUREMENTorNVDS_LATENCY_MEASUREMENT_SILENT).mux->latency_metadata_listgets oneg_list_appendper frame. Before each batch is pushed, the nodes are detached withg_list_remove_link()and never freed. The fix replaces that loop withg_list_free(). Only the list nodes are owned by the mux. TheNvDsMetaCompLatencydata is still released with the batch meta throughnvds_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-py3container (CUDA 13.4, TensorRT 11.4.0.106, VPI 4.1.4, NVDS 9.2.1).bash ./build/build.sh --packagecompleted successfully in 25 min. It produceddeepstream-9.2_9.2.1-1_amd64.debanddeepstream_sdk_v9.2.1_x86_64.tbz2and installed to/opt/nvidia/deepstream/deepstream-9.2. The installedlibnvdsgst_multistream.soanddeepstream-appmatch the build output.source4 sanity test:
source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display.txt, run with the newly builtdeepstream-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:tools/modelopt/prepare_samples.py, astools/modelopt/README.mdrequires for TensorRT 11.int8-calib-filewas commented out in the three sampleconfig_infer_*.txtcopies. The TRT 11 nvinfer rejects it even withnetwork-mode=2.Leak test: reporter's pipeline (
nvurisrcbinRTSP 1080p24 -> legacynvstreammuxbatch-size=1 live-source=1 ->fakesink) withNVDS_ENABLE_LATENCY_MEASUREMENT=1. The patched and unpatched (cf9e610) builds ran side by side for 30 min.Not tested: the Jetson package build.
Checklist
NVIDIA/DeepStream:develop.NVIDIA/DeepStream:develop.bash ./build/build.sh --packagecompleted successfully.deepstream-appon x86 or Jetson.🤖 Generated with Claude Code