Implement memory monitoring functions for Linux OS
Created attachment 375409 [details] Patch
I wanted to post this for review/discussion. Initially I discussed this with my colleague Caio and he suggested to get this in WTF, except WTF already contains memory management functions for Linux under ./Source/WTF/wtf/linux/MemoryFootprintLinux.cpp but for a completely different purpose. Initially my reason for implementing this was to get results out of JetStream2 benchmark with memory information when ran with runMode='RAMification'. I would like to know if this is something that upstream would like to keep in jsc.cpp or move somewhere else (maybe WTF), possibly even merging it with current functionality? Suggestions welcome.
(In reply to Paulo Matos from comment #2) > I wanted to post this for review/discussion. Initially I discussed this with > my colleague Caio and he suggested to get this in WTF, except WTF already > contains memory management functions for Linux under > ./Source/WTF/wtf/linux/MemoryFootprintLinux.cpp but for a completely > different purpose. > > Initially my reason for implementing this was to get results out of > JetStream2 benchmark with memory information when ran with > runMode='RAMification'. > > I would like to know if this is something that upstream would like to keep > in jsc.cpp or move somewhere else (maybe WTF), possibly even merging it with > current functionality? Suggestions welcome. I think its reasonable to merge this with WTF/wtf/linux/MemoryFootprintLinux.cpp and share the code. For example, getCurrentMemoryUsage() can be implemented as returning ProcessMemoryStatus.resident after calling currentProcessMemoryStatus(ProcessMemoryStatus) Adding resetPeak() to MemoryFootprintLinux.cpp is also reasonable.
Thanks Carlos for the comments. Sorry for the delay but I have been on holidays. I will submit a new patch later on with the changes you suggest.
Created attachment 377965 [details] Patch
Comment on attachment 377965 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=377965&action=review Besides MemoryFootprintLinux.cpp, similar functionality also exists in bmalloc. At some point it would be nice to bring all this into a single place. > Source/WTF/wtf/linux/ProcessMemoryFootprint.h:30 > +#if OS(LINUX) > +#include <sys/resource.h> Nit: this would deserve an empty line in between. > Source/WTF/wtf/linux/ProcessMemoryFootprint.h:37 > + > + Nit: and this can do with a single empty line. > Source/WTF/wtf/linux/ProcessMemoryFootprint.h:46 > + return { ps.resident, static_cast<uint64_t>(ru.ru_maxrss)*1024 }; Nit: spaces around the multiplication operand.
Created attachment 379236 [details] Patch
Comment on attachment 379236 [details] Patch Rejecting attachment 379236 [details] from commit-queue. pmatos@igalia.com does not have committer permissions according to https://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.
The commit-queue encountered the following flaky tests while processing attachment 379236 [details]: imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker.html bug 202003 (author: youennf@gmail.com) The commit-queue is continuing to process your patch.
The commit-queue encountered the following flaky tests while processing attachment 379236 [details]: fetch/fetch-worker-crash.html bug 187257 (author: youennf@gmail.com) The commit-queue is continuing to process your patch.
Comment on attachment 379236 [details] Patch Clearing flags on attachment: 379236 Committed r250129: <https://trac.webkit.org/changeset/250129>
All reviewed patches have been landed. Closing bug.
<rdar://problem/55559829>