Comments (12)
Thank you. I think you're right. I'll fix it.
from wgcloud.
I checked the sigar data. Used includes buffers and cached
,And I've verified that it's right, with very little error
from wgcloud.
I've verified it. Now it seems that it should be correct. You can test the code again. Maybe you can improve the code and send the improved code here later.
from wgcloud.
Where did you get access to sigar doc, the official wiki doesn't response to me.
from wgcloud.
I checked the sigar data. Used includes buffers and cached
,And I've verified that it's right, with very little error
With this theory, the calculation process is right.
- My machine get s 1.0GB memory in total, with 116MB free , so the
used + cached/buffered
is 907, leads to 907/1024 = 88% memory usage.
But as I said,
I think there maybe a more reasonable method to calculate memory usage like this with formula:
Memory Utilization (%) = 100 -(((MemFree + Buffers + Cached)*100)/maxValue)
The key point is that I think the buffered/cached memory should not be calculated into used memory, it's still can be applied for new applications. Some reference:
- Meaning of the buffers/cache line in the output of free:
- It gives the original value for used minus the sum buffers+cached and the original value for free plus the sum buffers+cached, hence its title. These new values are often more meaningful
- Linux (like most modern OS) will always try to use free RAM for caching stuff, so Mem: free will almost always be very low. Therefore the line -/+ buffers/cache: is shown, because it shows how much memory is free when ignoring caches; caches will be freed automatically if memory gets scarce, so they do not really matter.
I'm not a professional operations engineer and don't know how you check the memory usage of your machine in daily work. You may catch the factors I mentioned above and reconsider which way is better.
from wgcloud.
As for the code part, I can't see the buffered/cached memory field via the decompiled sigar source code.
public class Mem implements Serializable {
private static final long serialVersionUID = 10181L;
long total = 0L;
long ram = 0L;
long used = 0L;
long free = 0L;
long actualUsed = 0L;
long actualFree = 0L;
double usedPercent = 0.0D;
double freePercent = 0.0D;
public Mem() {
}
}
You may give the actualUsed /actualFree a try, they may give us a more meaningful result.
from wgcloud.
可以用中文交流吗,我也不是专业运维工程师,也在交流和学习。
要不我们先关闭这个issue吧,等有好的解决方案时候再修复它。可以吗
from wgcloud.
可以,我觉得 sigar 的 Mem 类提供的 actualUsed /actualFree 就挺像是修正后的已使用内存/未使用内存。得空我验证下。
用英文是因为很多名词我翻译的不好,容易理解偏差。
from wgcloud.
上面提到的资料:
值得一看
from wgcloud.
另外,sigar 这个类库好老了,我看快十年没动代码了。
from wgcloud.
from wgcloud.
from wgcloud.
Related Issues (20)
- 无法监控集群系统里的挂载点 HOT 2
- 为什么我下载的agent源码,无法直接用idea运行,并且打包后运行jar提示没有主清单属性,能否给解答下 HOT 2
- 你确定你最新版本agent在idea中可以正常启动吗,我研究了好久都没解决问题,能否给讲解下 HOT 1
- 请问有支持webhook 功能吗 HOT 1
- 添加文件防篡改监控报错 403 HOT 6
- 开源的支持监控多少台服务器? HOT 7
- 左边的导航栏能不能固定不收缩,照顾一下曲面屏的用户。 HOT 1
- 你好,免费版本能监控多少台服务器? HOT 1
- 日志监控关键字支持与的关系吗? HOT 1
- 开源版本是否有大屏可视化? HOT 1
- Java.net.connectException: connection refused: connect HOT 1
- 无法监测docker容器 HOT 4
- 主机存在多IP,主机列表显示规则会出现多IP同主机的BUG吗 HOT 1
- 可以监控每个进程的网络流量吗? HOT 2
- 没有考虑过使用railway部署 wgcloud-server吗? HOT 1
- 未触发告警脚本 HOT 7
- Docker部署?
- agent怎么做到打包体积很小的呢 HOT 2
- agent支持docker部署吗
- 代码运行没看到web ssh
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 wgcloud.