mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
refine the memory watcher.
This commit is contained in:
parent
ca535fdb93
commit
573495a19f
4 changed files with 13 additions and 2 deletions
|
@ -961,6 +961,12 @@ void SrsSource::dispose()
|
||||||
hls->dispose();
|
hls->dispose();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// cleaup the cached packets.
|
||||||
|
srs_freep(cache_metadata);
|
||||||
|
srs_freep(cache_sh_video);
|
||||||
|
srs_freep(cache_sh_audio);
|
||||||
|
|
||||||
|
// cleanup the gop cache.
|
||||||
gop_cache->dispose();
|
gop_cache->dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ void srs_memory_report()
|
||||||
std::map<void*, SrsMemoryObject*>::iterator it;
|
std::map<void*, SrsMemoryObject*>::iterator it;
|
||||||
for (it = _srs_ptrs.begin(); it != _srs_ptrs.end(); ++it) {
|
for (it = _srs_ptrs.begin(); it != _srs_ptrs.end(); ++it) {
|
||||||
SrsMemoryObject* obj = it->second;
|
SrsMemoryObject* obj = it->second;
|
||||||
printf(" %s: %#"PRIx64", %dKB\n", obj->category.c_str(), (int64_t)obj->ptr, obj->size / 1000);
|
printf(" %s: %#"PRIx64", %dB\n", obj->category.c_str(), (int64_t)obj->ptr, obj->size);
|
||||||
total += obj->size;
|
total += obj->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,8 +192,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
* whether enable the special memory watcher.
|
* whether enable the special memory watcher.
|
||||||
* which used for memory leak debug and hurts performance.
|
* which used for memory leak debug and hurts performance.
|
||||||
*/
|
*/
|
||||||
#undef SRS_MEM_WATCH
|
|
||||||
#define SRS_MEM_WATCH
|
#define SRS_MEM_WATCH
|
||||||
|
#undef SRS_MEM_WATCH
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -211,6 +211,11 @@ void check_macro_features()
|
||||||
#warning "current branch is not stable, please use stable branch instead."
|
#warning "current branch is not stable, please use stable branch instead."
|
||||||
srs_warn("SRS %s is not stable, please use stable branch %s instead", RTMP_SIG_SRS_VERSION, VERSION_STABLE_BRANCH);
|
srs_warn("SRS %s is not stable, please use stable branch %s instead", RTMP_SIG_SRS_VERSION, VERSION_STABLE_BRANCH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SRS_MEM_WATCH
|
||||||
|
#warning "srs memory watcher will hurts performance. user should kill by SIGTERM or init.d script."
|
||||||
|
srs_warn("srs memory watcher will hurts performance. user should kill by SIGTERM or init.d script.");
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(SRS_AUTO_STREAM_CASTER)
|
#if defined(SRS_AUTO_STREAM_CASTER)
|
||||||
#warning "stream caster is experiment feature."
|
#warning "stream caster is experiment feature."
|
||||||
|
|
Loading…
Reference in a new issue