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