Re: Available memory
From: Allo (allother_at_things.equal)
Date: 02/29/04
- Next message: Casper H.S. ***: "Re: popen()"
- Previous message: Chris F.A. Johnson: "Re: possible to use korn shell with linux redhat 7.1?"
- In reply to: David Schwartz: "Re: Available memory"
- Next in thread: Nick Landsberg: "Re: Available memory"
- Reply: Nick Landsberg: "Re: Available memory"
- Reply: Rolf Magnus: "Re: Available memory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 29 Feb 2004 04:25:11 -0500
In article <c1roo3$o75$1@nntp.webmaster.com>, davids@webmaster.com
says...
>
> "those who know me have no need of my name" <not-a-real-address@usa.net>
> wrote in message news:m1y8qmo8iw.gnus@usa.net...
> > in comp.unix.programmer i read:
>
> >>Is there a function call, or a set of calls, that will tell me how much
> >>physical memory is available to grab with malloc?
>
>
> The 'malloc' function allocates virtual memory, not physical memory, so
> your question makes no sense.
Physical memory is part of virtual memory, so malloc actually does
allocate physical memory. If I determine the amount of unused physical
memory, then a request for a percentage of that amount should result in
an allocation that resides entirely within physical RAM. This should be
true unless the amount of allocated virtual memory exceeds the machine's
physical memory capacity (adjusted for whatever amount of physical
memory has been reserved by the operating system).
> A typical UNIX machine has a physical memory
> availability target (usually 2-32Mb) and there is nearly always that amount
> free.
>
> Free memory is only good for certain very specific things, such as
> handling a sudden burst of incoming network traffic. Other than that, free
> memory is wasted memory and there is no good reason for an operating system
> to waste anything.
If free memory is wasted memory, then a "physical memory availability
target" (i.e., an amount of physical memory that's always free) means
that memory waste is actually part of the system design.
- Next message: Casper H.S. ***: "Re: popen()"
- Previous message: Chris F.A. Johnson: "Re: possible to use korn shell with linux redhat 7.1?"
- In reply to: David Schwartz: "Re: Available memory"
- Next in thread: Nick Landsberg: "Re: Available memory"
- Reply: Nick Landsberg: "Re: Available memory"
- Reply: Rolf Magnus: "Re: Available memory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]