@@ -1510,6 +1510,9 @@ is no entry script.
15101510<!-- YAML
15111511added: v0.1.16
15121512changes:
1513+ - version: REPLACEME
1514+ pr-url: https://github.com/nodejs/node/pull/31550
1515+ description: Added `arrayBuffers` to the returned object.
15131516 - version: v7.2.0
15141517 pr-url: https://github.com/nodejs/node/pull/9587
15151518 description: Added `external` to the returned object.
@@ -1520,6 +1523,7 @@ changes:
15201523 * ` heapTotal ` {integer}
15211524 * ` heapUsed ` {integer}
15221525 * ` external ` {integer}
1526+ * ` arrayBuffers ` {integer}
15231527
15241528The ` process.memoryUsage() ` method returns an object describing the memory usage
15251529of the Node.js process measured in bytes.
@@ -1538,19 +1542,22 @@ Will generate:
15381542 rss: 4935680 ,
15391543 heapTotal: 1826816 ,
15401544 heapUsed: 650472 ,
1541- external: 49879
1545+ external: 49879 ,
1546+ arrayBuffers: 9386
15421547}
15431548```
15441549
1545- ` heapTotal ` and ` heapUsed ` refer to V8's memory usage.
1546- ` external ` refers to the memory usage of C++ objects bound to JavaScript
1547- objects managed by V8. ` rss ` , Resident Set Size, is the amount of space
1548- occupied in the main memory device (that is a subset of the total allocated
1549- memory) for the process, which includes the _ heap_ , _ code segment_ and _ stack_ .
1550-
1551- The _ heap_ is where objects, strings, and closures are stored. Variables are
1552- stored in the _ stack_ and the actual JavaScript code resides in the
1553- _ code segment_ .
1550+ * ` heapTotal ` and ` heapUsed ` refer to V8's memory usage.
1551+ * ` external ` refers to the memory usage of C++ objects bound to JavaScript
1552+ objects managed by V8.
1553+ * ` rss ` , Resident Set Size, is the amount of space occupied in the main
1554+ memory device (that is a subset of the total allocated memory) for the
1555+ process, including all C++ and JavaScript objects and code.
1556+ * ` arrayBuffers ` refers to memory allocated for ` ArrayBuffer ` s and
1557+ ` SharedArrayBuffer ` s, including all Node.js [ ` Buffer ` ] [ ] s.
1558+ This is also included in the ` external ` value. When Node.js is used as an
1559+ embedded library, this value may be ` 0 ` because allocations for ` ArrayBuffer ` s
1560+ may not be tracked in that case.
15541561
15551562When using [ ` Worker ` ] [ ] threads, ` rss ` will be a value that is valid for the
15561563entire process, while the other fields will only refer to the current thread.
@@ -2518,6 +2525,7 @@ cases:
25182525[ `'exit'` ] : #process_event_exit
25192526[ `'message'` ] : child_process.html#child_process_event_message
25202527[ `'uncaughtException'` ] : #process_event_uncaughtexception
2528+ [ `Buffer` ] : buffer.html
25212529[ `ChildProcess.disconnect()` ] : child_process.html#child_process_subprocess_disconnect
25222530[ `ChildProcess.send()` ] : child_process.html#child_process_subprocess_send_message_sendhandle_options_callback
25232531[ `ChildProcess` ] : child_process.html#child_process_class_childprocess
0 commit comments