diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-12-29 12:28:32 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-29 12:28:32 +0100 |
commit | 0d5e0e4cad512ebdcebc1c9a9171c412fcabbd3b (patch) | |
tree | a2de0fd9c829c96cd564413cae634319fb227ff8 /Applications/SystemMonitor/ProcessModel.cpp | |
parent | ffbe975ffc0e1a442247c5ff0a62b89aad9ac0a5 (diff) | |
download | serenity-0d5e0e4cad512ebdcebc1c9a9171c412fcabbd3b.zip |
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.
Diffstat (limited to 'Applications/SystemMonitor/ProcessModel.cpp')
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index 8d7f75e525..d84b52e59f 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -59,6 +59,8 @@ String ProcessModel::column_name(int column) const return "Virtual"; case Column::Physical: return "Physical"; + case Column::DirtyPrivate: + return "DirtyP"; case Column::PurgeableVolatile: return "Purg:V"; case Column::PurgeableNonvolatile: @@ -111,6 +113,8 @@ GModel::ColumnMetadata ProcessModel::column_metadata(int column) const return { 65, TextAlignment::CenterRight }; case Column::Physical: return { 65, TextAlignment::CenterRight }; + case Column::DirtyPrivate: + return { 65, TextAlignment::CenterRight }; case Column::PurgeableVolatile: return { 65, TextAlignment::CenterRight }; case Column::PurgeableNonvolatile: @@ -183,6 +187,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const return (int)thread.current_state.amount_virtual; case Column::Physical: return (int)thread.current_state.amount_resident; + case Column::DirtyPrivate: + return (int)thread.current_state.amount_dirty_private; case Column::PurgeableVolatile: return (int)thread.current_state.amount_purgeable_volatile; case Column::PurgeableNonvolatile: @@ -250,6 +256,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const return pretty_byte_size(thread.current_state.amount_virtual); case Column::Physical: return pretty_byte_size(thread.current_state.amount_resident); + case Column::DirtyPrivate: + return pretty_byte_size(thread.current_state.amount_dirty_private); case Column::PurgeableVolatile: return pretty_byte_size(thread.current_state.amount_purgeable_volatile); case Column::PurgeableNonvolatile: @@ -311,6 +319,7 @@ void ProcessModel::update() state.file_write_bytes = thread.file_write_bytes; state.amount_virtual = it.value.amount_virtual; state.amount_resident = it.value.amount_resident; + state.amount_dirty_private = it.value.amount_dirty_private; state.amount_purgeable_volatile = it.value.amount_purgeable_volatile; state.amount_purgeable_nonvolatile = it.value.amount_purgeable_nonvolatile; state.icon_id = it.value.icon_id; |