Skip to content

Commit

Permalink
report: fix typos in memory limit units
Browse files Browse the repository at this point in the history
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
  • Loading branch information
technic960183 committed Nov 29, 2024
1 parent b5eb77f commit fca9005
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions doc/api/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ is provided below for reference.
"soft": "",
"hard": "unlimited"
},
"data_seg_size_kbytes": {
"data_seg_size_bytes": {
"soft": "unlimited",
"hard": "unlimited"
},
Expand All @@ -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"
},
Expand All @@ -446,7 +446,7 @@ is provided below for reference.
"soft": "unlimited",
"hard": 4127290
},
"virtual_memory_kbytes": {
"virtual_memory_bytes": {
"soft": "unlimited",
"hard": "unlimited"
}
Expand Down
6 changes: 3 additions & 3 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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
};

Expand Down
6 changes: 3 additions & 3 deletions test/common/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit fca9005

Please sign in to comment.