java 获取系统内存的方法:mem.getUsed()的单位是什么
答案:1 悬赏:30 手机版
解决时间 2021-03-28 23:55
- 提问者网友:謫仙
- 2021-03-27 23:22
java 获取系统内存的方法:mem.getUsed()的单位是什么
最佳答案
- 五星知识达人网友:千夜
- 2021-03-27 23:42
单位一般是byte的
Runtime 有方法
totalMemory
public long totalMemory()
Returns the total amount of memory in the Java virtual machine.
The value returned by this method may vary over time, depending on
the host environment.
Note that the amount of memory required to hold an object of any
given type may be implementation-dependent.
Returns:
the total amount of memory currently available for current
and future objects, measured in bytes.
Runtime 有方法
totalMemory
public long totalMemory()
Returns the total amount of memory in the Java virtual machine.
The value returned by this method may vary over time, depending on
the host environment.
Note that the amount of memory required to hold an object of any
given type may be implementation-dependent.
Returns:
the total amount of memory currently available for current
and future objects, measured in bytes.
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯