public static void main(String[] args) {
        // 得到JVM中的空闲内存量(单位是m)
        System.out.println(Runtime.getRuntime().freeMemory()/1024/1024);
        // 的JVM内存总量(单位是m)
        System.out.println(Runtime.getRuntime().totalMemory()/1024/1024);
        // JVM试图使用额最大内存量(单位是m)
        System.out.println(Runtime.getRuntime().maxMemory()/1024/1024);
        // 可用处理器的数目
        System.out.println(Runtime.getRuntime().availableProcessors());
    }

可通过接口去查询

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2021-12-13
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2021-06-29
  • 2021-06-17
  • 2022-01-17
  • 2021-09-23
相关资源
相似解决方案