From fca9005e68d71aa59b0cc18f30fe468bdcba5321 Mon Sep 17 00:00:00 2001 From: Yuan-Ming Hsu <48866415+technic960183@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:26:44 +0800 Subject: [PATCH] report: fix typos in memory limit units Replace "kbytes" with "bytes" in `PrintSystemInformation()` in `src/node_report.cc`, as RLIMIT_DATA, RLIMIT_RSS, and RLIMIT_AS are given in bytes. Refs: https://www.ibm.com/docs/en/aix/7.3?topic=k-kgetrlimit64-kernel-service --- doc/api/report.md | 6 +++--- src/node_report.cc | 6 +++--- test/common/report.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/api/report.md b/doc/api/report.md index 90434dfa7d3c0c..59a85489412257 100644 --- a/doc/api/report.md +++ b/doc/api/report.md @@ -414,7 +414,7 @@ is provided below for reference. "soft": "", "hard": "unlimited" }, - "data_seg_size_kbytes": { + "data_seg_size_bytes": { "soft": "unlimited", "hard": "unlimited" }, @@ -426,7 +426,7 @@ is provided below for reference. "soft": "unlimited", "hard": 65536 }, - "max_memory_size_kbytes": { + "max_memory_size_bytes": { "soft": "unlimited", "hard": "unlimited" }, @@ -446,7 +446,7 @@ is provided below for reference. "soft": "unlimited", "hard": 4127290 }, - "virtual_memory_kbytes": { + "virtual_memory_bytes": { "soft": "unlimited", "hard": "unlimited" } diff --git a/src/node_report.cc b/src/node_report.cc index 4f430ee28218c3..8113182ddd848e 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -732,13 +732,13 @@ static void PrintSystemInformation(JSONWriter* writer) { int id; } rlimit_strings[] = { {"core_file_size_blocks", RLIMIT_CORE}, - {"data_seg_size_kbytes", RLIMIT_DATA}, + {"data_seg_size_bytes", RLIMIT_DATA}, {"file_size_blocks", RLIMIT_FSIZE}, #if !(defined(_AIX) || defined(__sun)) {"max_locked_memory_bytes", RLIMIT_MEMLOCK}, #endif #ifndef __sun - {"max_memory_size_kbytes", RLIMIT_RSS}, + {"max_memory_size_bytes", RLIMIT_RSS}, #endif {"open_files", RLIMIT_NOFILE}, {"stack_size_bytes", RLIMIT_STACK}, @@ -747,7 +747,7 @@ static void PrintSystemInformation(JSONWriter* writer) { {"max_user_processes", RLIMIT_NPROC}, #endif #ifndef __OpenBSD__ - {"virtual_memory_kbytes", RLIMIT_AS} + {"virtual_memory_bytes", RLIMIT_AS} #endif }; diff --git a/test/common/report.js b/test/common/report.js index 3280116feb83d9..bbcca1a3d194c0 100644 --- a/test/common/report.js +++ b/test/common/report.js @@ -309,11 +309,11 @@ function _validateContent(report, fields = []) { // Verify the format of the userLimits section on non-Windows platforms. if (!isWindows) { - const userLimitsFields = ['core_file_size_blocks', 'data_seg_size_kbytes', + const userLimitsFields = ['core_file_size_blocks', 'data_seg_size_bytes', 'file_size_blocks', 'max_locked_memory_bytes', - 'max_memory_size_kbytes', 'open_files', + 'max_memory_size_bytes', 'open_files', 'stack_size_bytes', 'cpu_time_seconds', - 'max_user_processes', 'virtual_memory_kbytes']; + 'max_user_processes', 'virtual_memory_bytes']; checkForUnknownFields(report.userLimits, userLimitsFields); for (const [type, limits] of Object.entries(report.userLimits)) { assert.strictEqual(typeof type, 'string');