-
-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
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
Memory sizes differences #427
Comments
I'm pretty sure #424 is relevant to this. Running the same code in Ubuntu, I get:
That looks pretty accurate to me (Only about 20MB difference in the available value, which could be attributed to many things) In Linux, Available Memory is an amalgam of a few other memory sets, one of which is Free Memory. This includes cached blocks of memory, and such, that aren't strictly free (not allocated) but are available for use. That's why you get 200MB free vs 2.3GB available. You must have the extra 2.1GB allocated to some Available set of memory. I'm not up to date on which exact version of everything is in each RHEL build, but just going by dates you might not have the right metrics available in RHEL6, but they should be there in RHEL7 |
@YoshiEnVerde has answered this but I'll amplify. On Linux the "free" memory slowly approaches zero the longer your system is operating, because memory released by programs returns to a "cached" or "buffer" pool rather than being "free". (It's possible but unnecessary to randomly free it.) For a trip down memory lane, see #23 which was my first contribution to this project, and I got hooked. :) |
Thanks a lot for your answers. I will continue to investigate. I would like to get the amount of memory as "top" displays it: Mem: 12198248k total, 11327824k used, 870424k free, 516600k buffers I think it is more significant to understand if my linux servers need memory add-on or not. Thanks and have a nice day. |
We will not display the memory as |
@dbwiddis
at the same time:
there is a difference between the available from the two free command and oshi |
What does the Pi say for Also, were these literally taken at the exact same time? Any program running (including Java, using oshi) may consume some memory, causing small differences. |
@dbwiddis any interest in a jenkins cluster to get better os test coverage with controlled hardware parameters? i keep seeing more and more issues like this and it's really a test coverage issue. We can only do so much with travis's linux environment |
I am more than happy to test in more places and on more systems. I have very little time to figure out how to set it all up myself! Can you help set it up? |
another capture of information.
it seems it is different |
@spyhunter99 I've thought about testing with Jenkins before, but the problem seems to be finding somewhere to host it (and cost). See oshi/oshi6#5. |
I'll open a separate ticket for the jenkins setup |
OSHI pulls the OSHI's used/total shows 123.4 MiB/242.6 MiB meaning 119.2 MiB is free, so we've used up 14.6 MB in memory between the command and having To do a true side by side test you need to have the java process running, outputting the memory at precisely the same time you're checking it independently. And given that on linux, |
I run OSHI libraries on both Windows and Linux.
It seemes to me that it works well on Windows, but not on Linux.
Please, See below what i've noticed.
Do i do something wrong ?
OSHI commands:
hal.getMemory().getTotal())/1024.0/1024.0
hal.getMemory().getAvailable())/1024.0/1024.0
On windows7:
-TaskMgr shows :
- Total: 8075 GB
- Available: 2032 GB
On Linux (red Hat 6/7):
- cat /proc/meminfo shows:
- Total: 11912.35 GB
- Free: 215732 kB
On Linux, it looks as if hal.getMemory().getAvailable() returns the used memory instead of free memory.
The text was updated successfully, but these errors were encountered: