Skip to content

Commit

Permalink
handle low ram usage
Browse files Browse the repository at this point in the history
  • Loading branch information
pennybelle committed Aug 31, 2024
1 parent e0c7dcf commit 06b9d71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pbfetch/parse_funcs/parse_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def parse_mem():
used = total - active
percent = round(active / total * 100)

if percent < 1:
percent = "<1"

return str(
f"{round(used/1024)} / " f"{round(total/1024)}" f" MB ({percent}%)"
)
Expand Down

0 comments on commit 06b9d71

Please sign in to comment.