Re: Get Available System Memory



But that's not what the OP asked. He asked about "currently available
system memory". That information is available,

That piece of information isn't even well-defined.

If a piece of physical memory contains a piece of a (heavily used)
shared library, it could be used to avoid a disk read of that shared
library, but it could also be used to satisfy a memory request
without having to write back a "dirty" page, is it "available"?
For that matter, is there any non-dirty page that is NOT "available"
if there's enough need for it?

That information is not available.
That information seems to be available to programs like ps, free, top,
vmstat and others, available on most unix systems. Are we talking about
different things here?

What statistic output by any of those programs are you referring to?

There's more than one way to skin a cat.

You seem to be intent on defining "currently available system memory"
as some fuzzily-defined statistic that is allegedly available from
the OS, and then claiming it's available. But with that fuzzy a
definition, it no longer MEANS anything. Remember, you can compute
anything in 0 time and 0 bytes if the answer isn't required to be
correct.

How about settling for
free(1)'s definition of how much memory there's available, after
adjusting for buffer/cache, i.e. the so called "buffer adjusted" values?

I haven't seen that definition, but doesn't it depend a lot on the
underlying OS strategy of whatever OS it runs on for handling buffers
and cache?

If there is a bare minimum of processes running (e.g. single user mode,
with init, shell, and top running and nothing much else), wouldn't you
expect almost all of the memory to be "available"? top doesn't agree if
you've just finished running "fsck". On some systems anyway.

I know. The output may be either misleading or hard to interpret at
certain times/states, but the info is available. Agree?

If you want a statistic, you need to define what the statistic MEANS,
then try to find a way to compute it, not just define what you want
as being some allegedly available statistic.

.



Relevant Pages

  • [PATCH] Update of Documentation/
    ... -memory subsystem of the Linux kernel. ... -swapcache reclaim. ... -Contains, as a percentage of total system memory, the number of pages at which ...
    (Linux-Kernel)
  • [PATCH v3] Update of Documentation/
    ... -memory subsystem of the Linux kernel. ... -swapcache reclaim. ... as a percentage of the dirtyable system memory (free pages + mapped ...
    (Linux-Kernel)
  • Virtual Memory Settings Locked
    ... I have a machine with 1GB RAM. ... The default system memory is 1.5 GB even ... though Task Manager shows that Page File usage rarely goes above 225 MB. ... I've run XP for weeks with virtual memory turned off completely with no ill ...
    (microsoft.public.windowsxp.general)
  • Re: What is the difference between /3GB and /PAE in boot.ini?
    ... System memory allocations are dynamic until they reach their maximum allocations. ... It allows the RAM above 4 GB to be addressed by changing memory addressing from 32-bit to 36-bit. ... The whole purpose is to fully utilize the memory available on the servers to increase the performance of the DB2 windows based servers. ...
    (microsoft.public.windows.server.general)
  • Memory usage during hidden plotting
    ... I notice that during this task, my used memory portion ... notice that when the function is finished running and I try to plot ... -- which brought MATLAB crashing down. ...
    (comp.soft-sys.matlab)