Comments (1)
- 测试代码:
<PackageReference Include="CZGL.SystemInfo" Version="2.2.0" />
try
{
var memory = MemoryHelper.GetMemoryValue();
var memorySize =
(float)Math.Round(memory.TotalPhysicalMemory * 1.0 / 1024 / 1024 / 1024, 2);
var memoryUsedSize =
(float)Math.Round(memory.UsedPhysicalMemory * 1.0 / 1024 / 1024 / 1024, 2);
Console.WriteLine($"memorySize:{memorySize}GB");
Console.WriteLine($"memoryUsedSize:{memoryUsedSize}GB");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
- 没有报错输出:
memorySize:0GB
memoryUsedSize:1.6173236E+10GB
uname -a
Linux 4.4.83 #132 SMP PREEMPT Tue Nov 8 15:29:19 CST 2022 armv7l armv7l a
cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
from czgl.systeminfo.
Related Issues (19)
- Get Unix Memory
- 调用接口/metrics会很大概率出现假死状态 HOT 1
- 支持多应用/分布式,支持主动推送
- nuget包中,没有网络流量的获取方法或者相关方法无效 HOT 3
- 如何提供一个 前端web api的接口,让前端对接。做自己的数据看板
- 新版本规划
- 请问maui是否支持 HOT 1
- 增加 prometheus 支持 HOT 3
- Linux下获取内存信息异常 HOT 12
- 最新版本获取linux已用内存不准 HOT 1
- 获取进程cpu、内存等信息 HOT 1
- 如何在容器中获取在应用程序在本容器使用的内存 HOT 4
- 监控数据没法显示 metrics界面打开都可以看到数据
- 修改设计 API,以监控为止 HOT 1
- Make it node_exporter HOT 1
- Input string was not in a correct format 导致进程崩溃 HOT 1
- 空引用异常 HOT 1
- 使用统一接口
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 czgl.systeminfo.