博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JAVA 虚拟机可用内存
阅读量:6867 次
发布时间:2019-06-26

本文共 667 字,大约阅读时间需要 2 分钟。

Total designated memory, this will equal the configured -Xmx value:

Runtime.getRuntime().maxMemory();

Current allocated free memory, is the current allocated space ready for new objects. Caution this is not the total free available memory:

Runtime.getRuntime().freeMemory();

Total allocated memory, is the total allocated space reserved for the java process:

Runtime.getRuntime().totalMemory();

Used memory, has to be calculated:

usedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();

Total free memory, has to be calculated:

freeMemory = Runtime.getRuntime().maxMemory() - usedMemory;

转载于:https://juejin.im/post/5c875605e51d453a8d01989f

你可能感兴趣的文章
45句忠告
查看>>
Host 127.0.0.1 is not allowed to connect MySQL
查看>>
【SQL Server学习笔记】表基础:数据类型、创建表、键、约束、表变量、给表和列增加注释...
查看>>
vsftpd+pam+mysql实现虚拟用户访问控制
查看>>
我所用到的sed知识总结(二)
查看>>
基于spring boot的spring data jpa配置
查看>>
一个delphi的hash函数
查看>>
Drupal开发时如何使用远端图片减轻工作量
查看>>
shell 编程初步
查看>>
centos系统中安装图形界面
查看>>
Web开发基础
查看>>
jQuery简介及语法
查看>>
linux版本选择
查看>>
linux-LVS负载均衡
查看>>
『中级篇』play with docker 的使用(44)
查看>>
MySQL-5.6.34通过show global status like 来查看sql语句的执行情
查看>>
H3 BPM让天下没有难用的流程之功能介绍
查看>>
JavaScript 模块化简析
查看>>
微服务架构:服务间通讯机制
查看>>
BeautifulSoup库未写明解析器警告
查看>>