diff options
author | Tom <tomut@yahoo.com> | 2021-01-03 10:13:33 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-03 22:12:19 +0100 |
commit | b5437216e23c144bc1d650cbd19ff15391497d01 (patch) | |
tree | 55d335d894d5eba03b10eec63d0723475aa1b4e8 /Applications | |
parent | 1d33765e1cd0d00466ce5cf13e7ae642268a5348 (diff) | |
download | serenity-b5437216e23c144bc1d650cbd19ff15391497d01.zip |
SystemMonitor: Re-use the /proc/all file descriptor when updating
This makes it more likely to be able to get statistics when resources
are scarce.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.cpp | 2 | ||||
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index 76562481a1..1c9f30a0ef 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -350,7 +350,7 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol void ProcessModel::update() { auto previous_pid_count = m_pids.size(); - auto all_processes = Core::ProcessStatisticsReader::get_all(); + auto all_processes = Core::ProcessStatisticsReader::get_all(m_proc_all); u64 last_sum_ticks_scheduled = 0; for (auto& it : m_threads) diff --git a/Applications/SystemMonitor/ProcessModel.h b/Applications/SystemMonitor/ProcessModel.h index 9c79d0fcc5..d54fecdb4b 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -159,6 +159,7 @@ private: RefPtr<Gfx::Bitmap> m_high_priority_icon; RefPtr<Gfx::Bitmap> m_low_priority_icon; RefPtr<Gfx::Bitmap> m_normal_priority_icon; + RefPtr<Core::File> m_proc_all; }; namespace AK { |