1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00
srs/trunk/doc
Winlin 41b3623296 API: Support new HTTP API for VALGRIND. v6.0.149 (#4150)
New features for valgrind:

1. ST: Support /api/v1/valgrind for leaking check.
2. ST: Support /api/v1/valgrind?check=full|added|changed|new|quick

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:

1. Compile SRS with Valgrind support: `./configure --valgrind=on &&
make`
2. Start SRS with memory leak detection enabled: `valgrind
--leak-check=full ./objs/srs -c conf/console.conf`
3. Trigger memory detection by using curl to access the API and generate
calibration data. There will still be many false positives, but these
can be ignored: `curl http://127.0.0.1:1985/api/v1/valgrind?check=added`
4. Perform load testing or test the suspected leaking functionality,
such as RTMP streaming: `ffmpeg -re -i doc/source.flv -c copy -f flv
rtmp://127.0.0.1/live/livestream`
5. Stop streaming and wait for SRS to clean up the Source memory,
approximately 30 seconds.
6. Perform incremental memory leak detection. The reported leaks will be
very accurate at this point: `curl
http://127.0.0.1:1985/api/v1/valgrind?check=added`

> Note: To avoid interference from the HTTP request itself on Valgrind,
SRS uses a separate coroutine to perform periodic checks. Therefore,
after accessing the API, you may need to wait a few seconds for the
detection to be triggered.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-08-21 15:39:59 +08:00
..
Architecture.md GB28181: Fix bug for parsing GB to RTC. 2022-10-07 19:47:34 +08:00
CHANGELOG.md API: Support new HTTP API for VALGRIND. v6.0.149 (#4150) 2024-08-21 15:39:59 +08:00
Dockers.md Use new cache image name. v6.0.86 (#3815) 2023-10-08 07:43:14 -05:00
Features.md WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 v6.0.36 (#3427) 2023-03-23 10:01:20 +08:00
ffmpeg-logo.png support ffmpeg filter 2013-12-01 10:54:41 +08:00
ffmpeg-min.png add drawtext filter sample 2013-12-01 12:04:00 +08:00
PERFORMANCE.md Improve README and documents with AI. v5.0.153. v6.0.43 (#3538) 2023-05-12 17:18:30 +08:00
README.md Micro changes and refines. 2022-09-30 17:57:48 +08:00
readme.txt Move doc 2020-01-26 11:14:18 +08:00
Resources.md Merge 4.0release, migrate to new website. 2022-07-31 18:34:18 +08:00
source.200kbps.768x320.flv update readme, add hls(audio-only) support to readme. update sample flv from h264+mp3 to h264+aac 2014-03-21 11:38:02 +08:00
source.flv SquashSRS4: Support RTC2RTMP. 2021-05-01 22:15:57 +08:00
srs-logo.ico Windows: Support cygwin pipline and packager. v5.0.89 (#3257) 2022-11-20 15:02:08 +08:00
srs-logo.png remove the libfreetype for it fullfill with bugs and always cause build failed. 0.9.139 2014-06-29 10:43:53 +08:00