Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Total available free memory for new processes ?
@ 2000-12-12 11:54 Alessandro Ipe
  2000-12-12 18:56 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alessandro Ipe @ 2000-12-12 11:54 UTC (permalink / raw)


Hi,


Our team needs to run an operational application that required a fixed &
large amount of memory. This application will be executed regularly,
i.e. each 15 min, so before running, we would like to check if there is
still sufficient amount of total free memory on the system to guarantee
that it will finish without memory allocation errors. Is there a system
command or function which can tell what is the maximum total amount of
memory available for new processes, i.e. which takes into account
virtual memory, buffer cache memory, etc.... ? We just need one number,
the total available size, not stats like those provided by "vmstat".

For info, we are running Tru64 v4.0F on a DS20E system.


Many thanks,


Alessandro.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Total available free memory for new processes ?
  2000-12-12 11:54 Total available free memory for new processes ? Alessandro Ipe
@ 2000-12-12 18:56 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
  2000-12-13  2:10 ` Stuart R. Fuller
  2000-12-19 19:27 ` Jack Patteeuw
  2 siblings, 0 replies; 4+ messages in thread
From: Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 2000-12-12 18:56 UTC (permalink / raw)



In article <3A36120B.B7A8211A@kmi-irm.oma.be>, Alessandro Ipe <Alessandro.Ipe@kmi-irm.oma.be> writes:
>
>Our team needs to run an operational application that required a fixed &
>large amount of memory. This application will be executed regularly,
>i.e. each 15 min, so before running, we would like to check if there is
>still sufficient amount of total free memory on the system to guarantee
>that it will finish without memory allocation errors. Is there a system
>command or function which can tell what is the maximum total amount of
>memory available for new processes, i.e. which takes into account
>virtual memory, buffer cache memory, etc.... ?

From the description it sounds like what you really want it to know the
amount of available page/swap space and the amount that is reserved.
This assume you're running with in "eager" page/swap reservation mode.

The swapon(8) command will show the amount of available, reserved
and allocated page/swap space.  The available and allocated parts
probably come from kernel tables that store information about each
page/swap space.

If you want to get the data from a program of your own, it gets
harder.  Some of the kernel data used by swapon(8) is available
via the table(2) system call using the TBL_SWAPINFO code.  The
data structure is described in <sys/table.h>.

The amount of reserved space is also kept by the kernel, but there
doesn't seem to be a documented interface to get the data.  In V4
and earlier, it was necessary to open /dev/kmem, seek to the right
address and read the data directly.  On V5, the data is equally hard
to get, but has been moved to a single kernel data structure.  You
can get the current Monitor sources from:

ftp.digital.com:/pub/DEC/monitor.alpha.tar.Z

to see how I did it in both cases.  Or, you can run swapon(8) using
a popen(3) call and parse the output.  Sometimes this is the best
way of getting the information.

So far I've concenrated on available page/swap space.  That's because
it is most relevant to whether an allocation will succeed.  For actual
"free" page of memory, vmstat(1) is your best choice.  This isn't
particularly useful since heavy buffer cache usage can cause the
free memory to appear very low.  However, if the data isn't in the
buffer cache isn't very dirty, getting back the memory is cheap.

Getting the data from swapon(8) isn't trivially easy method you're
looking for, but I think it is the way to go.

>
>For info, we are running Tru64 v4.0F on a DS20E system.
>
>
>Many thanks,
>
>
>Alessandro.
>
>
>
>
>
--
Alan Rollow				alan@nabeth.cxo.dec.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Total available free memory for new processes ?
  2000-12-12 11:54 Total available free memory for new processes ? Alessandro Ipe
  2000-12-12 18:56 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
@ 2000-12-13  2:10 ` Stuart R. Fuller
  2000-12-19 19:27 ` Jack Patteeuw
  2 siblings, 0 replies; 4+ messages in thread
From: Stuart R. Fuller @ 2000-12-13  2:10 UTC (permalink / raw)


Alessandro Ipe (Alessandro.Ipe@kmi-irm.oma.be) wrote:
: Hi,
: 
: 
: Our team needs to run an operational application that required a fixed &
: large amount of memory. This application will be executed regularly,
: i.e. each 15 min, so before running, we would like to check if there is
: still sufficient amount of total free memory on the system to guarantee
: that it will finish without memory allocation errors. 

In addition to Alan Rollow's comments, I would point out that if you are able
to find out the amount of free resources available at any one point in time,
that amount may change between then and when your application starts.

        Stu


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Total available free memory for new processes ?
  2000-12-12 11:54 Total available free memory for new processes ? Alessandro Ipe
  2000-12-12 18:56 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
  2000-12-13  2:10 ` Stuart R. Fuller
@ 2000-12-19 19:27 ` Jack Patteeuw
  2 siblings, 0 replies; 4+ messages in thread
From: Jack Patteeuw @ 2000-12-19 19:27 UTC (permalink / raw)


Alessandro Ipe wrote:
> 
> Hi,
> 
> Our team needs to run an operational application that required a fixed &
> large amount of memory. This application will be executed regularly,
> i.e. each 15 min, so before running, we would like to check if there is
> still sufficient amount of total free memory on the system to guarantee
> that it will finish without memory allocation errors.

<snip>

Usually the error message "memory allocation error" has to do with
hitting either the "data" or "vmemory" limits as seen with ulimit -a. 
Also note that "memory" limit reported by ulimit is "the number of
Kilobytes for the size of physical memory".


Jack Patteeuw


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-12-19 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-12 11:54 Total available free memory for new processes ? Alessandro Ipe
2000-12-12 18:56 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
2000-12-13  2:10 ` Stuart R. Fuller
2000-12-19 19:27 ` Jack Patteeuw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox