diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh
index 19498237c..1704b182e 100755
--- a/trunk/auto/auto_headers.sh
+++ b/trunk/auto/auto_headers.sh
@@ -111,12 +111,6 @@ else
srs_undefine_macro "SRS_HTTPS" $SRS_AUTO_HEADERS_H
fi
-if [ $SRS_MEM_WATCH = YES ]; then
- srs_define_macro "SRS_MEM_WATCH" $SRS_AUTO_HEADERS_H
-else
- srs_undefine_macro "SRS_MEM_WATCH" $SRS_AUTO_HEADERS_H
-fi
-
if [ $SRS_UTEST = YES ]; then
srs_define_macro "SRS_UTEST" $SRS_AUTO_HEADERS_H
else
diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh
index 18d0e7919..eb4433ecb 100755
--- a/trunk/auto/options.sh
+++ b/trunk/auto/options.sh
@@ -76,9 +76,6 @@ SRS_LOG_TRACE=YES
# donot compile ssl, use system ssl(-lssl) if required.
# TODO: Use pkg-config to get the openssl path.
SRS_USE_SYS_SSL=NO
-# enable memory watch, detect memory leak,
-# similar to gmc, should disable in release version for hurts performance.
-SRS_MEM_WATCH=NO
# export the srs-librtmp to specified project, NO to disable it.
SRS_EXPORT_LIBRTMP_PROJECT=NO
# export the srs-librtmp to a single .h and .c, NO to disable it.
@@ -376,7 +373,6 @@ function parse_user_option() {
--disable-all) SRS_DISABLE_ALL=YES ;;
--pure-rtmp) SRS_PURE_RTMP=YES ;;
--full) SRS_ENABLE_ALL=YES ;;
- --memory-watch) SRS_MEM_WATCH=YES ;;
--export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;;
--export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;;
--with-nginx) SRS_NGINX=YES ;;
diff --git a/trunk/configure b/trunk/configure
index 2b0f5be21..c49825233 100755
--- a/trunk/configure
+++ b/trunk/configure
@@ -204,7 +204,7 @@ MODULE_ID="CORE"
MODULE_DEPENDS=()
ModuleLibIncs=(${SRS_OBJS_DIR})
MODULE_FILES=("srs_core" "srs_core_version4" "srs_core_autofree" "srs_core_performance"
- "srs_core_mem_watch" "srs_core_time")
+ "srs_core_time")
CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
CORE_OBJS="${MODULE_OBJS[@]}"
#
diff --git a/trunk/ide/srs_upp/srs_upp.upp b/trunk/ide/srs_upp/srs_upp.upp
index 3c82bed66..36f931238 100755
--- a/trunk/ide/srs_upp/srs_upp.upp
+++ b/trunk/ide/srs_upp/srs_upp.upp
@@ -9,8 +9,6 @@ file
../../src/core/srs_core.cpp,
../../src/core/srs_core_autofree.hpp,
../../src/core/srs_core_autofree.cpp,
- ../../src/core/srs_core_mem_watch.hpp,
- ../../src/core/srs_core_mem_watch.cpp,
../../src/core/srs_core_performance.hpp,
../../src/core/srs_core_performance.cpp,
kernel readonly separator,
diff --git a/trunk/ide/srs_vs2010/srs.vcxproj b/trunk/ide/srs_vs2010/srs.vcxproj
index 95673b490..5c153cca3 100755
--- a/trunk/ide/srs_vs2010/srs.vcxproj
+++ b/trunk/ide/srs_vs2010/srs.vcxproj
@@ -101,7 +101,6 @@
-
@@ -167,7 +166,6 @@
-
diff --git a/trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj b/trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj
index 8f1ae9bd4..091a53f44 100644
--- a/trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj
+++ b/trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj
@@ -81,7 +81,6 @@
3C4AB9331B8C9148006627D3 /* srs_app_ng_exec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C4AB9311B8C9148006627D3 /* srs_app_ng_exec.cpp */; };
3C4D184C1E73F133008806F7 /* srs_app_fragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C4D184A1E73F133008806F7 /* srs_app_fragment.cpp */; };
3C4F97121B8B466D00FF0E46 /* srs_app_process.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C4F97101B8B466D00FF0E46 /* srs_app_process.cpp */; };
- 3C5265B41B241BF0009CA186 /* srs_core_mem_watch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C5265B21B241BF0009CA186 /* srs_core_mem_watch.cpp */; };
3C663F0F1AB0155100286D8B /* srs_aac_raw_publish.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F021AB0155100286D8B /* srs_aac_raw_publish.c */; };
3C663F101AB0155100286D8B /* srs_audio_raw_publish.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F031AB0155100286D8B /* srs_audio_raw_publish.c */; };
3C6F2D751E8653BF003D0805 /* srs_main_mp4_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C6F2D741E8653BF003D0805 /* srs_main_mp4_parser.cpp */; };
@@ -343,7 +342,6 @@
3C4D184B1E73F133008806F7 /* srs_app_fragment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_fragment.hpp; path = ../../../src/app/srs_app_fragment.hpp; sourceTree = ""; };
3C4F97101B8B466D00FF0E46 /* srs_app_process.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_process.cpp; path = ../../../src/app/srs_app_process.cpp; sourceTree = ""; };
3C4F97111B8B466D00FF0E46 /* srs_app_process.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_process.hpp; path = ../../../src/app/srs_app_process.hpp; sourceTree = ""; };
- 3C5265B21B241BF0009CA186 /* srs_core_mem_watch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_core_mem_watch.cpp; path = ../../../src/core/srs_core_mem_watch.cpp; sourceTree = ""; };
3C6673CF1DF7B93200A6DF57 /* readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = readme.txt; path = ../../../modules/readme.txt; sourceTree = ""; };
3C6673D11DF7B95E00A6DF57 /* config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = config; path = "../../../modules/hls-ingester/config"; sourceTree = ""; };
3C6F2D731E86536B003D0805 /* config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = config; path = "../../../modules/mp4-parser/config"; sourceTree = ""; };
@@ -473,8 +471,6 @@
children = (
3C1231F01AAE652C00CE8F6C /* srs_core_autofree.cpp */,
3C1231F11AAE652C00CE8F6C /* srs_core_autofree.hpp */,
- 3C5265B21B241BF0009CA186 /* srs_core_mem_watch.cpp */,
- 3C5265B31B241BF0009CA186 /* srs_core_mem_watch.hpp */,
3C1231F21AAE652C00CE8F6C /* srs_core_performance.cpp */,
3C1231F31AAE652C00CE8F6C /* srs_core_performance.hpp */,
3C1231F41AAE652D00CE8F6C /* srs_core.cpp */,
@@ -984,7 +980,6 @@
3C663F151AB0155100286D8B /* srs_h264_raw_publish.c in Sources */,
3C1231F61AAE652D00CE8F6C /* srs_core_autofree.cpp in Sources */,
8C0652B12035B5BA000B0661 /* srs_app_coworkers.cpp in Sources */,
- 3C5265B41B241BF0009CA186 /* srs_core_mem_watch.cpp in Sources */,
3C1EE6D71AB1367D00576EE9 /* README.md in Sources */,
3C82802C1BAFF8CC004A1794 /* srs_kafka_stack.cpp in Sources */,
3C1232411AAE81A400CE8F6C /* srs_raw_avc.cpp in Sources */,
diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp
index 5bfe48111..39141bf55 100644
--- a/trunk/src/app/srs_app_server.cpp
+++ b/trunk/src/app/srs_app_server.cpp
@@ -50,7 +50,6 @@ using namespace std;
#include
#include
#include
-#include
#include
#include
#include
@@ -745,10 +744,6 @@ void SrsServer::dispose()
_srs_sources->dispose();
// @remark don't dispose all connections, for too slow.
-
-#ifdef SRS_MEM_WATCH
- srs_memory_report();
-#endif
}
void SrsServer::gracefully_dispose()
@@ -790,10 +785,6 @@ void SrsServer::gracefully_dispose()
_srs_sources->dispose();
srs_trace("source disposed");
-#ifdef SRS_MEM_WATCH
- srs_memory_report();
-#endif
-
srs_usleep(_srs_config->get_grace_final_wait());
srs_trace("final wait for %dms", srsu2msi(_srs_config->get_grace_final_wait()));
}
@@ -1169,10 +1160,6 @@ void SrsServer::on_signal(int signo)
#ifdef SRS_GPERF_MC
srs_trace("gmc is on, main cycle will terminate normally, signo=%d", signo);
signal_gmc_stop = true;
-#else
- #ifdef SRS_MEM_WATCH
- srs_memory_report();
- #endif
#endif
}
diff --git a/trunk/src/core/srs_core_mem_watch.cpp b/trunk/src/core/srs_core_mem_watch.cpp
deleted file mode 100644
index bc39e8523..000000000
--- a/trunk/src/core/srs_core_mem_watch.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2013-2020 Winlin
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include
-
-#ifdef SRS_MEM_WATCH
-
-#include