Skip to content

Commit

Permalink
SystemMonitor: Re-use the /proc/all file descriptor when updating
Browse files Browse the repository at this point in the history
This makes it more likely to be able to get statistics when resources
are scarce.
  • Loading branch information
tomuta authored and awesomekling committed Jan 3, 2021
1 parent 1d33765 commit b543721
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Applications/SystemMonitor/ProcessModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Applications/SystemMonitor/ProcessModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class ProcessModel final : public GUI::Model {
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 {
Expand Down

0 comments on commit b543721

Please sign in to comment.