Remove the duplicate variable of server structure 13/270613/2 accepted/tizen/unified/20220208.011108 submit/tizen/20220207.085737
authorYoungHun Kim <yh8004.kim@samsung.com>
Mon, 7 Feb 2022 04:50:41 +0000 (13:50 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Mon, 7 Feb 2022 07:33:16 +0000 (16:33 +0900)
Change-Id: I8d1259d42e5a4056dd7991d0ab6eed936d37c298

packaging/mused.spec
server/include/muse_server_private.h
server/src/muse_server_private.c

index 9a6070ddd7a610e18586fbaa0d6b0e76970e03cf..7e8e2245b23d86e4707205e9bf556e5005617233 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.140
+Version:    0.3.141
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 6add38f0b7d5c12d0f9d77ac9cf7dc69434aa45f..02e4bbbc495f1ef737056c96851f1d6af8f3122e 100644 (file)
@@ -81,7 +81,6 @@ typedef struct _muse_server {
        int stop;
        int retval;
        int pid;
-       int cpu_threshold;
        tbm_bufmgr bufmgr;
        GMainLoop *main_loop;
        ms_diag_t diag;
index bcbe8ae094da0e470d4d88c8977ca66ad064c60f..1b8867c721e9d52a475774f2a37995e1233646d3 100644 (file)
@@ -645,8 +645,6 @@ static void _ms_init(void)
 
        muse_core_create_fd_table();
 
-       muse_server->cpu_threshold = ms_config_get_cpu_threshold();
-
        muse_server->main_loop = g_main_loop_new(NULL, FALSE);
        muse_return_if_fail(muse_server->main_loop);
 
@@ -1111,7 +1109,7 @@ int ms_deinit(void)
 
 void ms_check_cpu_memory(void)
 {
-       int used_pss, memory_threshold, cpu_usage;
+       int used_pss, memory_threshold, cpu_usage, cpu_threshold;
        char err_msg[MUSE_MSG_LEN_MAX] = {'\0',};
        ms_connection_t *connection = NULL;
 
@@ -1127,13 +1125,15 @@ void ms_check_cpu_memory(void)
                cpu_usage = muse_core_get_process_cpu_usage(muse_server->pid);
 
                LOGW("[%d] Proportional set size %d (KByte) (CPU %d %%)", muse_server->pid, used_pss, cpu_usage);
+
                memory_threshold = ms_config_get_memory_threshold();
+               cpu_threshold = ms_config_get_cpu_threshold();
 
-               if (used_pss >= memory_threshold || cpu_usage >= muse_server->cpu_threshold) {
+               if (used_pss >= memory_threshold || cpu_usage >= cpu_threshold) {
                        ms_log_process_info(muse_server->pid);
 
                        snprintf(err_msg, sizeof(err_msg), "[Memory Leak] %d >= %d (KByte) [CPU] %d >= %d %%",
-                               used_pss, memory_threshold, cpu_usage, muse_server->cpu_threshold);
+                               used_pss, memory_threshold, cpu_usage, cpu_threshold);
 
                        LOGE("%s", err_msg);
                        ms_connection_unlock(connection);