4 * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * @file lowmem_process.h
22 * @desc grouping process and setting oom adj value
25 #ifndef __LOWMEM_PROCESS_H__
26 #define __LOWMEM_PROCESS_H__
28 #include <proc_stat.h>
31 #define OOMADJ_INIT (100)
32 #define OOMADJ_FOREGRD_LOCKED (150)
33 #define OOMADJ_FOREGRD_UNLOCKED (200)
34 #define OOMADJ_BACKGRD_LOCKED (250)
35 #define OOMADJ_BACKGRD_UNLOCKED (300)
36 #define OOMADJ_APP_LIMIT OOMADJ_INIT
37 #define OOMADJ_APP_MAX (990)
38 #define OOMADJ_APP_INCREASE (30)
40 int lowmem_get_proc_cmdline(pid_t pid, char *cmdline);
41 int lowmem_sweep_memory(int callpid);
43 int get_proc_oom_score_adj(int pid, int *oom_score_adj);
44 int set_proc_oom_score_adj(int pid, int oom_score_adj);
46 int lowmem_set_foregrd(int pid, int oom_score_adj);
47 int lowmem_set_backgrd(int pid, int oom_score_adj);
49 int lowmem_set_active(int pid, int oom_score_adj);
50 int lowmem_set_inactive(int pid, int oom_score_adj);
52 int lowmem_get_candidate_pid(void);
54 #endif /*__LOWMEM_PROCESS_H__*/