Fix wrong initialization 11/289211/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 2 Mar 2023 23:34:02 +0000 (23:34 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 2 Mar 2023 23:34:02 +0000 (23:34 +0000)
The memory monitor initialization should be called before adding default slots.
If the threshold is greater than 100, the memory monitor should be disabled.

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

index 6fd6ef4..88d0f39 100644 (file)
@@ -3351,6 +3351,8 @@ static int __before_loop(int argc, char** argv) {
     _W("Failed to initialize dbus");
 
   _inotify_init();
+  _memory_monitor_init();
+  _memory_monitor_set_event_cb(__memory_monitor_cb, nullptr);
 
   MAX_CPU_CHECK_COUNT =
       _config_get_int_value(CONFIG_TYPE_CPU_CHECKER_MAX_COUNT);
@@ -3378,8 +3380,6 @@ static int __before_loop(int argc, char** argv) {
 
   __register_vconf_events();
   __init_app_defined_loader_monitor();
-  _memory_monitor_init();
-  _memory_monitor_set_event_cb(__memory_monitor_cb, nullptr);
   _log_init();
   _print_hwc_log("%s(%d): END", __FUNCTION__, __LINE__);