question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RAM usage is occasionally represented as a negative value

See original GitHub issue

Hi,

With this i3pystatus mem config:

status.register("mem", 
    format="RAM: {used_mem}/{total_mem} GiB", 
    color="#FFFFFF", 
    divisor=1073741824
    )

I get negative values for RAM usage in my i3status bar. Here is a screenshot to show it (I’ve circled or rather rectangled around it in red to point it out): negmem-i3pystatus-redcirc

I have tried to fix this myself by throwing abs around the RHS of L48 and L50 of the mem.py file. It made no difference I’m afraid. This issue is intermittent, by-the-way, when I’ve just booted my system after several hours of it being off the issue is not there but after the system has been up for several hours the issue is there. Any ideas on how to fix this issue?

Thanks for your time, Brenton

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
laserscommented, Mar 20, 2019
>>> -4509715660.8 / (1024 ** 3)
-4.2  # GiB

I don’t see how it can be an issue with mem module. The values comes from psutil. https://psutil.readthedocs.io/en/latest/#memory

I wanted to know if mem should keep printing occasional negative values or do we replace occasional negative values with 0 to make it easier for users? (i.e. hide negative values from users)

If you like https://github.com/lasers/i3pystatus/commit/ea46f44d4bf8bb9bcac043ae34a4ff583978b220, I can make a PR.

0reactions
fusion809commented, Jan 10, 2019

With my present configs it isn’t.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does memory utilization show negative results? - TechNet
If "Total Memory (MB)" is 5 GB, but "Available Bytes (MB)" is greater than 5 GB, then "Available Bytes (MB)" is definitely being...
Read more >
Memory limit doesn't accept the negative value
Memory limit doesn't accept the negative value. Trying to edit a vm, results in the error you can see. If I reload the...
Read more >
Negative Free Memory - java - Stack Overflow
It means after you've sorted, the garbage collector has probably freed more memory and you have more than you started out with.
Read more >
Why Is Google Chrome Using So Much RAM? Here's How to ...
If you see Chrome using a lot of memory, but there are no negative performance consequences, it is not worth worrying about. For...
Read more >
Memory usage - Advanced R. - Hadley Wickham
Positive numbers represent an increase in the memory used by R, and negative numbers represent a decrease. # Need about 4 mb to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found