From c74cde918a5ef031d5f01c663212b1c909564cf4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 29 Dec 2019 12:45:58 +0100 Subject: Kernel+SystemMonitor: Expose amount of per-process clean inode memory This is memory that's loaded from an inode (file) but not modified in memory, so still identical to what's on disk. This kind of memory can be freed and reloaded transparently from disk if needed. --- Applications/SystemMonitor/ProcessModel.cpp | 9 +++++++++ Applications/SystemMonitor/ProcessModel.h | 2 ++ 2 files changed, 11 insertions(+) (limited to 'Applications') diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index d84b52e59f..88fa965907 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -61,6 +61,8 @@ String ProcessModel::column_name(int column) const return "Physical"; case Column::DirtyPrivate: return "DirtyP"; + case Column::CleanInode: + return "CleanI"; case Column::PurgeableVolatile: return "Purg:V"; case Column::PurgeableNonvolatile: @@ -115,6 +117,8 @@ GModel::ColumnMetadata ProcessModel::column_metadata(int column) const return { 65, TextAlignment::CenterRight }; case Column::DirtyPrivate: return { 65, TextAlignment::CenterRight }; + case Column::CleanInode: + return { 65, TextAlignment::CenterRight }; case Column::PurgeableVolatile: return { 65, TextAlignment::CenterRight }; case Column::PurgeableNonvolatile: @@ -189,6 +193,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const return (int)thread.current_state.amount_resident; case Column::DirtyPrivate: return (int)thread.current_state.amount_dirty_private; + case Column::CleanInode: + return (int)thread.current_state.amount_clean_inode; case Column::PurgeableVolatile: return (int)thread.current_state.amount_purgeable_volatile; case Column::PurgeableNonvolatile: @@ -258,6 +264,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const return pretty_byte_size(thread.current_state.amount_resident); case Column::DirtyPrivate: return pretty_byte_size(thread.current_state.amount_dirty_private); + case Column::CleanInode: + return pretty_byte_size(thread.current_state.amount_clean_inode); case Column::PurgeableVolatile: return pretty_byte_size(thread.current_state.amount_purgeable_volatile); case Column::PurgeableNonvolatile: @@ -320,6 +328,7 @@ void ProcessModel::update() 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_clean_inode = it.value.amount_clean_inode; 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 e8a38d5948..cccedbcb3a 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -31,6 +31,7 @@ public: Virtual, Physical, DirtyPrivate, + CleanInode, PurgeableVolatile, PurgeableNonvolatile, Syscalls, @@ -74,6 +75,7 @@ private: size_t amount_virtual; size_t amount_resident; size_t amount_dirty_private; + size_t amount_clean_inode; size_t amount_purgeable_volatile; size_t amount_purgeable_nonvolatile; unsigned syscall_count; -- cgit v1.2.3