Re: physical memory allocated to a program
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 17:58:38 -0700 (PDT)
On Mar 28, 2:59 am, mohi <mohangupt...@xxxxxxxxx> wrote:
presently i was reading about physical memory allocators and wanted
to know ,as the size entry of the program( the size of the program in
directory entry) includes the size of the code of the program and not
that of the dynamic memory which that program may require(as i
think) ,so how does the kernel or the allocater decides what block of
memory should be actually allocated to the program(which will also
include the dynamic memory which may be required by the program beside
the memory required for its code.
You have a tendency to ask very vague questions. If I understand your
question correctly, which I may or may not, the answer is: The
allocator gives the process any page of physical memory that it is not
currently using. If it has no free physical memory, it finds a
discardable page and frees it. A page is "discardable" if it contains
data the kernel can easily get back, such as an unmodified copy of a
piece of a file.
This is done on-demand, as explained in the other thread you started.
When the process accesses a page that is not resident in memory, the
kernel's fault handler is invoked. If the fault handler determines
that the access is valid, it maps a page of physical memory at the
address that caused the fault and the process resumes.
DS
.
- References:
- physical memory allocated to a program
- From: mohi
- physical memory allocated to a program
- Prev by Date: Re: allocation of memory to a program
- Next by Date: Re: physical memory allocated to a program
- Previous by thread: Re: physical memory allocated to a program
- Next by thread: Re: physical memory allocated to a program
- Index(es):
Relevant Pages
|