1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_MEMORY_MEMMGR_RECALIM_STRATEGY_CONSTANTS_H 17 #define OHOS_MEMORY_MEMMGR_RECALIM_STRATEGY_CONSTANTS_H 18 19 namespace OHOS { 20 namespace Memory { 21 // default values of buffer param (MB) 22 constexpr int AVAIL_BUFFER = 800; 23 constexpr int MIN_AVAIL_BUFFER = 750; 24 constexpr int HIGH_AVAIL_BUFFER = 850; 25 constexpr int SWAP_RESERVE = 200; 26 // default values of memcg reclaim ratios 27 constexpr int MEMCG_MEM_2_ZRAM_RATIO = 60; // 60% 28 constexpr int MEMCG_ZRAM_2_UFS_RATIO = 10; // 10% 29 constexpr int MEMCG_REFAULT_THRESHOLD = 50; // 50 times 30 // default reclaim ratios of root memcg 31 constexpr int ROOT_MEMCG_MEM_2_ZRAM_RATIO = 40; // 60% 32 constexpr int ROOT_MEMCG_ZRAM_2_UFS_RATIO = 0; // 0% 33 constexpr int ROOT_MEMCG_REFAULT_THRESHOLD = 0; // 0 times 34 // default score of memcg 35 constexpr int APP_SCORE = 300; 36 constexpr int PERCENT_100 = 100; 37 // default score range 38 constexpr int RECLAIM_SCORE_MIN = 0; 39 constexpr int RECLAIM_SCORE_MAX = 1000; 40 // min vaule of user id 41 constexpr int VALID_USER_ID_MIN = 100; 42 } // namespace Memory 43 } // namespace OHOS 44 #endif // OHOS_MEMORY_MEMMGR_RECALIM_STRATEGY_CONSTANTS_H 45