Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux下获取内存信息异常 #20

Closed
huangchangxu opened this issue Dec 24, 2022 · 12 comments
Closed

Linux下获取内存信息异常 #20

huangchangxu opened this issue Dec 24, 2022 · 12 comments

Comments

@huangchangxu
Copy link

image

@whuanle
Copy link
Owner

whuanle commented Dec 25, 2022

用的是 net7 还是之前的版本

@whuanle
Copy link
Owner

whuanle commented Dec 25, 2022

你的 Linux 版本是啥,内核版本是啥

1 similar comment
@whuanle
Copy link
Owner

whuanle commented Dec 25, 2022

你的 Linux 版本是啥,内核版本是啥

@huangchangxu
Copy link
Author

net6 引用的CZGL.SystemInfo最新版本。
系统信息如截图:
image

@LeZi9916
Copy link

net6 引用的CZGL.SystemInfo最新版本。 系统信息如截图: image

这个问题好像在net6才有,net7并没有这个问题

@cfoan
Copy link

cfoan commented Feb 16, 2023

今天发现的linux内存占用率有问题,用的net7,CZGL.SystemInfo版本2.0.0.0。
获取的内存数据如下:

"TotalPhysicalMemory":959_877_120
"AvailablePhysicalMemory":83_779_584
"UsedPhysicalMemory":876_097_536
"UsedPercentage":0

UsedPercentage应该是91多,后查看代码大概是这里不对
CZGL.SystemInfo.LinuxMemory.GetMemory里面
image

@whuanle
Copy link
Owner

whuanle commented Feb 21, 2023

@cfoan
除了百分比外,其它数值应该没问题吧

@whuanle
Copy link
Owner

whuanle commented Feb 21, 2023

image

@whuanle
Copy link
Owner

whuanle commented Feb 21, 2023

@cfoan @huangchangxu @XiaoSong0919
问题修复了。
另外关于 6.0,7.0 的问题,做了处理,7.0 支持 Native AOT,6.0 使用旧方法。

@whuanle whuanle closed this as completed Feb 21, 2023
@Hyalei
Copy link

Hyalei commented Mar 24, 2023

@cfoan @huangchangxu @XiaoSong0919 问题修复了。 另外关于 6.0,7.0 的问题,做了处理,7.0 支持 Native AOT,6.0 使用旧方法。
我今天使用Linux测试的内存信息的代码,发现报错仍然存在,以下是我的代码片段和系统信息,我是用的是dotnet6.0

代码片段

NuGet包版本

获取Linux内存异常

linux内核信息

@whuanle
Copy link
Owner

whuanle commented Mar 24, 2023 via email

@Hyalei
Copy link

Hyalei commented Mar 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants