Skip to content

Commit

Permalink
Possible memory leak #2976
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Oct 31, 2024
1 parent a2c609c commit a6956bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions glances/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,13 @@ def update(self):
except KeyError:
pass

# Remove non running process from the cache (avoid issue #2976)
pids_running = [p['pid'] for p in processlist]
pids_cached = [p for p in self.processlist_cache.keys()]
for pid in pids_cached:
if pid not in pids_running:
self.processlist_cache.pop(pid, None)

# Filter and transform process export list
self.processlist_export = self.update_export_list(processlist)

Expand Down

0 comments on commit a6956bf

Please sign in to comment.