1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 22:42:08 +00:00

Show the amount of memory in GraphicsBitmaps in /bin/top.

This seems like an extremely relevant metric to track.
This commit is contained in:
Andreas Kling 2019-02-05 09:27:27 +01:00
parent b1e054ffe8
commit 41567c5bb9
6 changed files with 37 additions and 13 deletions

View file

@ -2201,6 +2201,16 @@ size_t Process::amount_virtual() const
return amount;
}
size_t Process::amount_in_bitmaps() const
{
size_t amount = 0;
for (auto& region : m_regions) {
if (region->is_bitmap())
amount += region->size();
}
return amount;
}
size_t Process::amount_resident() const
{
// FIXME: This will double count if multiple regions use the same physical page.