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 | |
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')
-rw-r--r-- | Applications/SystemMonitor/ProcessMemoryMapWidget.cpp | 1 | ||||
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.cpp | 9 | ||||
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.h | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp index 2a7955e13c..b6e1b7a6d5 100644 --- a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp +++ b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp @@ -18,6 +18,7 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget(GWidget* parent) }); pid_vm_fields.empend("size", "Size", TextAlignment::CenterRight); pid_vm_fields.empend("amount_resident", "Resident", TextAlignment::CenterRight); + pid_vm_fields.empend("amount_dirty", "Dirty", TextAlignment::CenterRight); pid_vm_fields.empend("Access", TextAlignment::CenterLeft, [](auto& object) { StringBuilder builder; if (!object.get("user_accessible").to_bool()) 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; diff --git a/Applications/SystemMonitor/ProcessModel.h b/Applications/SystemMonitor/ProcessModel.h index 15d734e246..e8a38d5948 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -30,6 +30,7 @@ public: TID, Virtual, Physical, + DirtyPrivate, PurgeableVolatile, PurgeableNonvolatile, Syscalls, @@ -72,6 +73,7 @@ private: String priority; size_t amount_virtual; size_t amount_resident; + size_t amount_dirty_private; size_t amount_purgeable_volatile; size_t amount_purgeable_nonvolatile; unsigned syscall_count; |