| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1ebe7d7 commit 0c469b3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1573,26 +1573,19 @@ changes: | |||
| 1573 | 1573 | * `external` {integer} | |
| 1574 | 1574 | * `arrayBuffers` {integer} | |
| 1575 | 1575 | ||
| 1576 | - The `process.memoryUsage()` method returns an object describing the memory usage | ||
| 1577 | - of the Node.js process measured in bytes. | ||
| 1578 | - | ||
| 1579 | - For example, the code: | ||
| 1576 | + Returns an object describing the memory usage of the Node.js process measured in | ||
| 1577 | + bytes. | ||
| 1580 | 1578 | ||
| 1581 | 1579 | ```js | |
| 1582 | 1580 | console.log(process.memoryUsage()); | |
| 1583 | - ``` | ||
| 1584 | - | ||
| 1585 | - Will generate: | ||
| 1586 | - | ||
| 1587 | - <!-- eslint-skip --> | ||
| 1588 | - ```js | ||
| 1589 | - { | ||
| 1590 | - rss: 4935680, | ||
| 1591 | - heapTotal: 1826816, | ||
| 1592 | - heapUsed: 650472, | ||
| 1593 | - external: 49879, | ||
| 1594 | - arrayBuffers: 9386 | ||
| 1595 | - } | ||
| 1581 | + // Prints: | ||
| 1582 | + // { | ||
| 1583 | + // rss: 4935680, | ||
| 1584 | + // heapTotal: 1826816, | ||
| 1585 | + // heapUsed: 650472, | ||
| 1586 | + // external: 49879, | ||
| 1587 | + // arrayBuffers: 9386 | ||
| 1588 | + // } | ||
| 1596 | 1589 | ``` | |
| 1597 | 1590 | ||
| 1598 | 1591 | * `heapTotal` and `heapUsed` refer to V8's memory usage. | |
@@ -1610,8 +1603,8 @@ Will generate: | |||
| 1610 | 1603 | When using [`Worker`][] threads, `rss` will be a value that is valid for the | |
| 1611 | 1604 | entire process, while the other fields will only refer to the current thread. | |
| 1612 | 1605 | ||
| 1613 | - The `process.memoryUsage()` method iterate over each page to gather | ||
| 1614 | - informations about memory usage which can be slow depending on the | ||
| 1606 | + The `process.memoryUsage()` method iterates over each page to gather | ||
| 1607 | + information about memory usage which might be slow depending on the | ||
| 1615 | 1608 | program memory allocations. | |
| 1616 | 1609 | ||
| 1617 | 1610 | ## `process.memoryUsage.rss()` | |
@@ -1628,7 +1621,8 @@ The Resident Set Size, is the amount of space occupied in the main | |||
| 1628 | 1621 | memory device (that is a subset of the total allocated memory) for the | |
| 1629 | 1622 | process, including all C++ and JavaScript objects and code. | |
| 1630 | 1623 | ||
| 1631 | - This is the same value as the one returned by `process.memoryUsage()`. | ||
| 1624 | + This is the same value as the `rss` property provided by `process.memoryUsage()` | ||
| 1625 | + but `process.memoryUsage.rss()` is faster. | ||
| 1632 | 1626 | ||
| 1633 | 1627 | ```js | |
| 1634 | 1628 | console.log(process.memoryUsage.rss()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments