-
Notifications
You must be signed in to change notification settings - Fork 44
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
Memory usage is very incorrect on some projects #250
Comments
Hi ! Very good remarks ! Thanks for you ideas :) I'm gonna improve benchmark that way when I get some time ! For the first point, I was unsure Webview2 (for example) would be embed in the sum, but your idea looks neat, I'm definitely gonna try to see if that gaves great results. |
* #250 - Add another way to measure used memory * #252 - Count additional files size * Fix system memory usage storage when persisting data * Upgrade to node18 NodeGUI/qode now support it: https://github.com/nodegui/nodegui/releases/tag/v0.58.0 * Fix median value calculation * Force garbage collection to make results more accurate * Improvements in memory calculation * Improve logging * Use tree-kill instead of custom function to try terminating all process without issues * Update benchmarks
Some projects use the system webview, when they allocate and use the system webivew the memory is allocated by the system and so it shows up as being used by the system. It unfortunately is not actually tracked against the process. This gives you a very invalid idea of how much memory the actual process is actually using...
For example, Wails (or Tauri) might just 40m memory usage, but the system might be using another 60m of memory for the webview instance that it is managing on behalf of the Tauri/Wails app. To get the actual memory usage of these types of projects, you need to measure total system memory usage before app is ran, and then while app is being ran to see how much memory the system had to allocate for the process. Doing this either multiple times in a row or running the app multiple times at the same time can give you the approximate memory usage the system is allocating for each run of app that is using a system webview. (Please note, when checking global memory you will also need to check for additional used swap memory usage, and ignore any memory used or freed by caches)
In my tests, the majority of the memory is NOT shared between instances and is allocated per instance of the app. Even though the system is allocating the memory, it is purely for the app and is not actually shared.
One other very minor nitpick, the html used in each app (for those using a webview) should be as close to identical as possible. For example if I do
<div>This is Electron</div>
and do<div><p><b>This is NW.JS</b></p></div>
the memory NW.JS uses in the webview will be more than Electron, because you now have three HTMLNodes having to be allocated by the webview in NW.JS vs the one in Electron. So to make things a lot closer, I would recommend that at least for your base tests, that the html displayed is as close to identical as possible to eliminate any extra css or html that has to be rendered, processed and allocated... 😀The text was updated successfully, but these errors were encountered: