Edit: I'm thinking about marking this question as answered since I've realized that I was pretty confused by the fact that file sizes were zero. This caused me to have a brain fart and panic. After reading the answers below I realized that I've often read these files before but it never occurred to me to check their filesizes. Therefore my question is misleading. I should have only asked why the file sizes were 0 only.
This is not a question about missing ram - but it may be a question about file sizes of 0. Am I looking at files that have zero file size because they are aliases to data in ram rather than on disk?
I understand that procinfo gathers information from the /proc directory on a linux box. But I've taken a look in that directory and can't figure out what files it actually queries. It appears as though most files are 0 bytes. What's really odd is that a particular file, kcore is listed as 128T on my system.
I've read that kcore represents the amount of ram on my system but I am sure I don't have 128T of ram (I have 12GB). I took a look at a second server that I rebooted and the file was 884M (that server has 1GB of ram).
I believe that, whether or not kcore is being used, procinfo is providing statistics based on data in ram. And I believe that is verified by procinfo's inability to keep data after a reboot.
I have two questions:
Would someone care to clarify these assumptions and add some helpful observations about this performance tool?
What is kcore if it's not a representation of the ram on my system (as I've read)?
Many of the files in
/proc
are listed byls
as having zero bytes, but if youcat
them the will show some piece of information.(where
$$
is resolved by the shell to the current PID)To answer the question about why files under proc show 0 byte size:
Files under /proc aren't regular files, but simulated by the kernel. Their content can (and will change) constantly, so there's no useful notion of "file size" (as the size changes constantly). That is probably the reason why the sytem shows them as "size 0".
/proc/kcore is not being used by procinfo. Observe that a normal user can run procinfo fine, while they are normally not able to read kcore.
Are you sure you read /proc/kcore size correctly ? check the size with
ls -lh
, and compare with values fromfree
Have a look at
man proc
for a detailed explanation of each entry. There is a lot of redundancy, but memory usage can be extracted from/proc/meminfo
, load averages from/proc/loadavg
, and IRQ data from/proc/interrupts
.For your second server, there is a kernel setting on x86 "High Memory Support" that, if not enabled, will limit your physical memory to a bit more than 800MB, maybe you are affected by this ?
The /poc/kcore represents the MAX-memory your system can handle. In your case, you are running a 64-bit operating system, which means you can have 128TB of mem.