From ead07566d0cef544849d541733d7decd3a53be81 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 2 Mar 2023 23:34:02 +0000 Subject: [PATCH] Fix wrong initialization 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 --- src/launchpad-process-pool/launchpad.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/launchpad-process-pool/launchpad.cc b/src/launchpad-process-pool/launchpad.cc index 6fd6ef4..88d0f39 100644 --- a/src/launchpad-process-pool/launchpad.cc +++ b/src/launchpad-process-pool/launchpad.cc @@ -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__); -- 2.7.4