@@ -1482,6 +1482,9 @@ is no entry script.
14821482<!-- YAML
14831483added: v0.1.16
14841484changes:
1485+ - version: REPLACEME
1486+ pr-url: https://github.com/nodejs/node/pull/31550
1487+ description: Added `arrayBuffers` to the returned object.
14851488 - version: v7.2.0
14861489 pr-url: https://github.com/nodejs/node/pull/9587
14871490 description: Added `external` to the returned object.
@@ -1492,6 +1495,7 @@ changes:
14921495 * ` heapTotal ` {integer}
14931496 * ` heapUsed ` {integer}
14941497 * ` external ` {integer}
1498+ * ` arrayBuffers ` {integer}
14951499
14961500The ` process.memoryUsage() ` method returns an object describing the memory usage
14971501of the Node.js process measured in bytes.
@@ -1510,19 +1514,22 @@ Will generate:
15101514 rss: 4935680 ,
15111515 heapTotal: 1826816 ,
15121516 heapUsed: 650472 ,
1513- external: 49879
1517+ external: 49879 ,
1518+ arrayBuffers: 9386
15141519}
15151520```
15161521
1517- ` heapTotal ` and ` heapUsed ` refer to V8's memory usage.
1518- ` external ` refers to the memory usage of C++ objects bound to JavaScript
1519- objects managed by V8. ` rss ` , Resident Set Size, is the amount of space
1520- occupied in the main memory device (that is a subset of the total allocated
1521- memory) for the process, which includes the _ heap_ , _ code segment_ and _ stack_ .
1522-
1523- The _ heap_ is where objects, strings, and closures are stored. Variables are
1524- stored in the _ stack_ and the actual JavaScript code resides in the
1525- _ code segment_ .
1522+ * ` heapTotal ` and ` heapUsed ` refer to V8's memory usage.
1523+ * ` external ` refers to the memory usage of C++ objects bound to JavaScript
1524+ objects managed by V8.
1525+ * ` rss ` , Resident Set Size, is the amount of space occupied in the main
1526+ memory device (that is a subset of the total allocated memory) for the
1527+ process, including all C++ and JavaScript objects and code.
1528+ * ` arrayBuffers ` refers to memory allocated for ` ArrayBuffer ` s and
1529+ ` SharedArrayBuffer ` s, including all Node.js [ ` Buffer ` ] [ ] s.
1530+ This is also included in the ` external ` value. When Node.js is used as an
1531+ embedded library, this value may be ` 0 ` because allocations for ` ArrayBuffer ` s
1532+ may not be tracked in that case.
15261533
15271534When using [ ` Worker ` ] [ ] threads, ` rss ` will be a value that is valid for the
15281535entire process, while the other fields will only refer to the current thread.
@@ -2490,6 +2497,7 @@ cases:
24902497[ `'exit'` ] : #process_event_exit
24912498[ `'message'` ] : child_process.html#child_process_event_message
24922499[ `'uncaughtException'` ] : #process_event_uncaughtexception
2500+ [ `Buffer` ] : buffer.html
24932501[ `ChildProcess.disconnect()` ] : child_process.html#child_process_subprocess_disconnect
24942502[ `ChildProcess.send()` ] : child_process.html#child_process_subprocess_send_message_sendhandle_options_callback
24952503[ `ChildProcess` ] : child_process.html#child_process_class_childprocess
0 commit comments