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);
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;
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);