process.memoryUsage.rss()
- 返回: <integer>
process.memoryUsage.rss()
方法返回以字节为单位表示驻留集大小的整数 (RSS)。
驻留集大小是进程在主内存设备(即总分配内存的子集)中占用的空间量,包括所有 C++ 和 JavaScript 对象和代码。
这与 process.memoryUsage()
提供的 rss
属性值相同,但 process.memoryUsage.rss()
更快。
import { memoryUsage } from 'node:process';
console.log(memoryUsage.rss());
// 35655680
const { rss } = require('node:process');
console.log(memoryUsage.rss());
// 35655680
- Returns: <integer>
The process.memoryUsage.rss()
method returns an integer representing the
Resident Set Size (RSS) in bytes.
The Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the process, including all C++ and JavaScript objects and code.
This is the same value as the rss
property provided by process.memoryUsage()
but process.memoryUsage.rss()
is faster.
import { memoryUsage } from 'node:process';
console.log(memoryUsage.rss());
// 35655680
const { rss } = require('node:process');
console.log(memoryUsage.rss());
// 35655680