New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement process.getProcessMemoryInfo to get the process memory info #16591
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,6 +14,7 @@ In sandboxed renderers the `process` object contains only a subset of the APIs: | |||||
- `crash()` | ||||||
- `hang()` | ||||||
- `getHeapStatistics()` | ||||||
- `getProcessMemoryInfo()` | ||||||
- `getSystemMemoryInfo()` | ||||||
- `getCPUUsage()` | ||||||
- `getIOCounters()` | ||||||
|
@@ -157,6 +158,27 @@ Returns `Object`: | |||||
|
||||||
Returns an object with V8 heap statistics. Note that all statistics are reported in Kilobytes. | ||||||
|
||||||
### `process.getProcessMemoryInfo()` | ||||||
|
||||||
Returns `Object`: | ||||||
|
||||||
* `residentSet` Integer _Linux_ and _Windows_ - The amount of memory | ||||||
currently pinned to actual physical RAM in Kilobytes. | ||||||
* `private` Integer - The amount of memory not shared by other processes, such as | ||||||
JS heap or HTML content in Kilobytes. | ||||||
* `shared` Integer - The amount of memory shared between processes, typically | ||||||
memory consumed by the Electron code itself in Kilobytes. | ||||||
|
||||||
Returns an object giving memory usage statistics about the current process. Note | ||||||
that all statistics are reported in Kilobytes. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(Typically spelled using lowercase) |
||||||
This api should be called after app ready. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Chromium does not provide `residentSet` value for macOS. This is because macOS | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
performs in-memory compression of pages that haven't been recently used. As a | ||||||
result the resident set size value is not what one would expect. `private` memory | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
is more representative of the actual pre-compression memory usage of the process | ||||||
on macOS. | ||||||
|
||||||
### `process.getSystemMemoryInfo()` | ||||||
|
||||||
Returns `Object`: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.