Exectue malloc_trim() to release free memory from the top of the heap 88/244188/6 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.114614 accepted/tizen/6.0/unified/hotfix/20201103.003528 accepted/tizen/unified/20200918.123705 submit/tizen/20200917.045119 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_6.0.m2_release
authorYoungHun Kim <yh8004.kim@samsung.com>
Tue, 15 Sep 2020 23:07:30 +0000 (08:07 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 16 Sep 2020 06:46:38 +0000 (15:46 +0900)
Change-Id: I0750d569919faadc9675568a80063116acfa8e6f

packaging/mused.spec
server/src/muse_server_system.c

index d48f77a..f3c192b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.126
+Version:    0.3.127
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index bb391d7..2dbb188 100644 (file)
@@ -23,6 +23,7 @@
 #include <storage.h>
 #include <system_info.h>
 #include <runtime_info.h>
+#include <malloc.h>
 
 #define MUSE_STORAGE_EXTERNAL_FEATURE          "http://tizen.org/feature/storage.external"
 
@@ -413,9 +414,14 @@ int ms_system_get_memory_usage(int pid)
 {
        int used_pss = 0;
        process_memory_info_s *info = NULL;
-       int ret = runtime_info_get_process_memory_info(&pid, 1, &info);
+       int ret = 0;
 
-       if (MM_ERROR_NONE == ret && info)
+       if (malloc_trim(0) == 0)
+               LOGW("It was not possible to release any memory");
+
+       ret = runtime_info_get_process_memory_info(&pid, 1, &info);
+
+       if (RUNTIME_INFO_ERROR_NONE == ret && info)
                used_pss = info->pss;
        else
                LOGE("Fail to get process (%d) memory %s", pid, get_error_message(ret));