Code Monkey home page Code Monkey logo

Comments (1)

alinayaa avatar alinayaa commented on July 21, 2024
  • 测试代码:
<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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.