We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Once system has enough cached memory, getUsableMemory() is way off.
getUsableMemory()
SystemInfo::instance().getUsableMemory() / 1024 returns:
SystemInfo::instance().getUsableMemory() / 1024
$ ./a.out 1729184
While:
$ grep '^MemAvailable:' /proc/meminfo MemAvailable: 2665180 kB
(this machine does not have swap)
MemAvailable was added in kernel 3.14:
MemAvailable
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
free show its value in "available" column.
free
Adding it to the sysinfo structure was attempted, without success:
https://lore.kernel.org/linux-mm/[email protected]/T/
Hence parsing /proc/meminfo is the only choice:
/proc/meminfo
https://bugs.openjdk.org/browse/JDK-8305770 openjdk/jdk@b6bcbc0
For older kernels without MemAvailable, a not so wrong estimate is MemFree + Cached + Buffers - Shmem:
rfjakob/earlyoom#12
but cannot be done only with sysinfo() information, because it lacks cached memory metric.
sysinfo()
Using cbang-git b3f10ca.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Once system has enough cached memory,
getUsableMemory()
is way off.SystemInfo::instance().getUsableMemory() / 1024
returns:While:
(this machine does not have swap)
MemAvailable
was added in kernel 3.14:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
free
show its value in "available" column.Adding it to the sysinfo structure was attempted, without success:
https://lore.kernel.org/linux-mm/[email protected]/T/
Hence parsing
/proc/meminfo
is the only choice:https://bugs.openjdk.org/browse/JDK-8305770
openjdk/jdk@b6bcbc0
For older kernels without
MemAvailable
, a not so wrong estimate is MemFree + Cached + Buffers - Shmem:rfjakob/earlyoom#12
but cannot be done only with
sysinfo()
information, because it lacks cached memory metric.Using cbang-git b3f10ca.
The text was updated successfully, but these errors were encountered: