Comments (5)
Interesting, might be an overflow - we count bytes - let's see if we can widen that type :)
from nethogs.
I'm pretty sure this is an overflow since we're using uint32_t
to count bytes, and maximum for that type (2^32 - 1) works out to be approximately 4.2GB (and regardless of what view you specify, the totals are stored as bytes and converted to the unit you asked for). That's stored per connection, but it's also summed per process... so I think it's quite likely that (especially on a busy server or a desktop with a process that's doing a lot of network IO like a game, torrent client, single-process browser, or streaming video) it can wrap around - that will happen with any process that sends or receives more than 4.2 GB.
If we bumped all of the total bytes counters from uint32_t to uint64_t, we'd end up consuming a bit more memory (an additional 64 bytes per connection, plus some program-wide overhead for summing) and change the public API of libnethogs, but we'd be able to count 2^64 - 1 bytes, or 18.4 exabytes (that's 18,446,744.1 terabytes) before wrapping around.
from nethogs.
Sounds like a good idea to me!
from nethogs.
Ok, I'll give a try at a PR for this one once I get some feedback on my other open PRs; this is going to change a lot of variable types, so it would be a rather painful rebase.
from nethogs.
Thanks for this fix @jantman
from nethogs.
Related Issues (20)
- macos problem HOT 1
- Memory steadily climbs in -v 3 -s mode HOT 1
- make libnethogs have error HOT 1
- error when making libnethogs HOT 4
- Does nethogs support multicast ip addresses such as "239.0.0.1"?
- Good
- Compiling errors in Centos 7.9 HOT 6
- 100% CPU usage in libnethogs when invoking multiple times in an application. Fix suggested.
- Pointless function
- nethogs seems to be unable to calculate network usage properly on Ubuntu 22.10 HOT 2
- How to keep it running in background.
- How to cross-compile the nethogs?
- unintelligible units HOT 7
- Error dispatching for device enp5s0f4u2: The interface disappeared
- feature request: show destination IP
- Create KDE system monitor sensor face
- [Question] License terms when using libnethogs dynamically linked HOT 3
- -P processID1 processID2 ... processIDn HOT 1
- nethogs keeps counting network usage for a process that long terminated HOT 5
- Feature request: option to disable printing the "caption" at the top (Nethogs version x.x.x) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nethogs.