API: Support new HTTP API for VALGRIND. v6.0.149 v7.0.6 #4150
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.
New features for valgrind:
To use Valgrind to detect memory leaks in SRS, even though Valgrind hooks are supported in ST, there are still many false positives. A more reasonable approach is to have Valgrind report incremental memory leaks. This way, global and static variables can be avoided, and detection can be achieved without exiting the program. Follow these steps:
./configure --valgrind=on && make
valgrind --leak-check=full ./objs/srs -c conf/console.conf
curl http://127.0.0.1:1985/api/v1/valgrind?check=added
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://127.0.0.1/live/livestream
curl http://127.0.0.1:1985/api/v1/valgrind?check=added
Co-authored-by: Jacob Su suzp1984@gmail.com