mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 09:04:53 +00:00
Kernel+SystemMonitor: Expose amount of per-process dirty private memory
Dirty private memory is all memory in non-inode-backed mappings that's process-private, meaning it's not shared with any other process. This patch exposes that number via SystemMonitor, giving us an idea of how much memory each process is responsible for all on its own.
This commit is contained in:
@@ -2502,6 +2502,16 @@ void Process::die()
|
||||
}
|
||||
}
|
||||
|
||||
size_t Process::amount_dirty_private() const
|
||||
{
|
||||
size_t amount = 0;
|
||||
for (auto& region : m_regions) {
|
||||
if (!region.is_shared())
|
||||
amount += region.amount_dirty();
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
size_t Process::amount_virtual() const
|
||||
{
|
||||
size_t amount = 0;
|
||||
|
||||
Reference in New Issue
Block a user