return mem to os

This commit is contained in:
gccgdb1234 2022-10-29 22:25:40 +08:00
parent 419e501002
commit f52000d86e
3 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,7 @@ void *taosMemoryStrDup(const char *ptr);
void taosMemoryFree(void *ptr);
int64_t taosMemorySize(void *ptr);
void taosPrintBackTrace();
void taosMemoryTrim(int32_t size);
#define taosMemoryFreeClear(ptr) \
do { \

View File

@ -28,6 +28,7 @@ static void *dmStatusThreadFp(void *param) {
int64_t curTime = taosGetTimestampMs();
float interval = (curTime - lastTime) / 1000.0f;
if (interval >= tsStatusInterval) {
taosMemoryTrim(0);
dmSendStatusReq(pMgmt);
lastTime = curTime;
}

View File

@ -336,3 +336,7 @@ int64_t taosMemorySize(void *ptr) {
#endif
#endif
}
void taosMemoryTrim(int32_t size) {
malloc_trim(size);
}