Fix memory monitor function 80/262480/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 11 Aug 2021 22:53:17 +0000 (07:53 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 11 Aug 2021 22:53:17 +0000 (07:53 +0900)
If the threshold is 100, the memory_monitor_is_low_memory() function
always returns false. The value of the threshold that is 100 means the
feature is disabled.

Change-Id: I5c72297ca11dfa3d70c39c412a5bee1bc3f76790
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/src/launchpad_memory_monitor.c

index 7bd3d4a..d4d4b2d 100644 (file)
@@ -96,6 +96,9 @@ bool _memory_monitor_is_low_memory(void)
 {
        unsigned int mem_used_ratio = 0;
 
+       if (__monitor.threshold == 100)
+               return false;
+
        _proc_get_mem_used_ratio(&mem_used_ratio);
 
        _W("previous used ratio(%u), current used ratio(%u)",