From a3aaaa37ef65fc945094081b8ad6909156c431c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Thu, 14 Dec 2023 12:22:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=20j=20=E5=80=BC?= =?UTF-8?q?=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/calculate_j.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/calculate_j.sh b/scripts/calculate_j.sh index abd51a4c..459f658b 100644 --- a/scripts/calculate_j.sh +++ b/scripts/calculate_j.sh @@ -21,9 +21,7 @@ along with this program. If not, see . # 计算 j 值(通用) calculate_j() { export LC_ALL=C - total_mem=$(free -m | awk '/^Mem:/{print $2}') - total_swap=$(free -m | awk '/^Swap:/{print $2}') - total=$((total_mem + total_swap)) + total=$(free -m | awk '/^Mem:/{print $2}') j_value=$((total / 1024)) cpu_cores=$(nproc) @@ -41,9 +39,7 @@ calculate_j() { # 计算 j 值(2倍内存) calculate_j2() { export LC_ALL=C - total_mem=$(free -m | awk '/^Mem:/{print $2}') - total_swap=$(free -m | awk '/^Swap:/{print $2}') - total=$((total_mem + total_swap)) + total=$(free -m | awk '/^Mem:/{print $2}') j_value=$((total / 2024)) cpu_cores=$(nproc)