Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个程序来获取有关 RAM 的信息
我怎样才能做到这一点?
该类中有几个与内存相关的方法Runtime,但请注意,它们仅提供有关 JVM 可用(或使用)内存量的信息,而不是运行它的硬件。
Runtime
一般来说,Java 是做这种事情的错误语言,因为它需要访问 Java 不提供的操作系统 API。
您需要的大部分信息都包含在Runtime类中。看看链接。它应该是直截了当的。如果您遇到问题,我会尽力帮助您。