Fix wrong initialization 12/289212/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:36:39 +0000 (23:36 +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/src/launchpad.c

index e5ca89028141f7650339425d4b6647ad30a60761..8c9dfb4bd02765fd4360e78e977ffe60324a865b 100644 (file)
@@ -3471,6 +3471,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, NULL);
 
        MAX_CPU_CHECK_COUNT = _config_get_int_value(
                        CONFIG_TYPE_CPU_CHECKER_MAX_COUNT);
@@ -3496,8 +3498,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, NULL);
        _log_init();
        _print_hwc_log("%s(%d): END", __FUNCTION__, __LINE__);