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
Conversation
…y usage (#14847) * feat: Implement process.getMemoryFootprint to get the process memory usage * Add spec * fix: must enter node env in callback * Update function call * Update spec * Update API data * update spec * Update include * update test for shared bytes * Update atom/common/api/atom_bindings.cc Co-Authored-By: nitsakh <nitsakh@icloud.com> * Update atom/common/api/atom_bindings.cc Co-Authored-By: nitsakh <nitsakh@icloud.com> * Update API * Update the callback isolate * Update to work after app ready * Update docs * Update docs/api/process.md Co-Authored-By: nitsakh <nitsakh@icloud.com> * Update docs/api/process.md Co-Authored-By: nitsakh <nitsakh@icloud.com> * Fix crash
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.
Please include this fix #16593
|
||
if (mate::Locker::IsBrowserProcess() && !Browser::Get()->is_ready()) { | ||
promise->RejectWithErrorMessage( | ||
"Memory Info is available only after app ready"); |
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.
"Memory Info is available only after app ready"); | |
"Memory information is only available after the app's 'ready' event (See: electronjs.org/docs/api/app)"); |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
that all statistics are reported in Kilobytes. | |
that all statistics are reported in kilobytes. |
(Typically spelled using lowercase)
|
||
Returns an object giving memory usage statistics about the current process. Note | ||
that all statistics are reported in Kilobytes. | ||
This api should be called after app ready. |
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.
This api should be called after app ready. | |
This API should not be called before the `app` has emitted the `ready` event. |
that all statistics are reported in Kilobytes. | ||
This api should be called after app ready. | ||
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Chromium does not provide `residentSet` value for macOS. This is because macOS | |
Chromium does not provide a `residentSet` value for macOS. This is because macOS |
|
||
Chromium does not provide `residentSet` value for macOS. This is because macOS | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
result the resident set size value is not what one would expect. `private` memory | |
result, the resident set size value is not what one would expect. `private` memory |
Sorry for the swarm of suggestions, feel free to disregard them as you please. Thank you for the overall effort! |
😬 This is a backport of #14847 . Suggestions look good, but I'll probably address those in a separate PR. |
@miniak I agree with Nitish, let's merge those changes separately. |
@felixrieseberg Thank you for the suggestions, they're awesome. |
Release Notes Persisted
|
Backport of #14847.
Description of Change
Checklist
npm test
passesRelease Notes
Notes: Added getProcessMemoryInfo API