From 7996b3b7894a697bac77fb1d1979c4f4d2d6e749 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 9 Jun 2015 10:52:32 +0800 Subject: [PATCH] add warning for gmp, use gmc to detect memory leak. --- trunk/auto/summary.sh | 4 ++-- trunk/src/main/srs_main_server.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/trunk/auto/summary.sh b/trunk/auto/summary.sh index cbe5cc075..4ed5b1376 100755 --- a/trunk/auto/summary.sh +++ b/trunk/auto/summary.sh @@ -37,11 +37,11 @@ echo -e "\${GREEN}build summary:\${BLACK}" echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}" echo -e " |${SrsGperfSummaryColor}gperf @see: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_GPERF\${BLACK}" echo -e " | ${SrsGperfMCSummaryColor}gmc @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\${BLACK}" -echo -e " | ${SrsGperfMCSummaryColor}gmc: gperf memory check\${BLACK}" +echo -e " | ${SrsGperfMCSummaryColor}gmc: gperf memory check, or memory leak detect\${BLACK}" echo -e " | ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/console.conf # start gmc\${BLACK}" echo -e " | ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\${BLACK}" echo -e " | ${SrsGperfMPSummaryColor}gmp @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\${BLACK}" -echo -e " | ${SrsGperfMPSummaryColor}gmp: gperf memory profile\${BLACK}" +echo -e " | ${SrsGperfMPSummaryColor}gmp: gperf memory profile, similar to gcp\${BLACK}" echo -e " | ${SrsGperfMPSummaryColor}rm -f gperf.srs.gmp*; ./objs/srs -c conf/console.conf # start gmp\${BLACK}" echo -e " | ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmp\${BLACK}" echo -e " | ${SrsGperfMPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gmp* # to analysis memory profile\${BLACK}" diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index d0750f2fe..b53504b7e 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -254,6 +254,11 @@ int main(int argc, char** argv) "it is not possible to run both the heap-checker and heap profiler at the same time"); #endif + // never use gmp to check memory leak. +#ifdef SRS_AUTO_GPERF_MP + #warning "gmp is not used for memory leak, please use gmc instead." +#endif + // never use srs log(srs_trace, srs_error, etc) before config parse the option, // which will load the log config and apply it. if ((ret = _srs_config->parse_options(argc, argv)) != ERROR_SUCCESS) {