Re: physical memory allocated to a program



mohi wrote:
hello everyone,
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.
mohan

You must distinguish between virtual memory allocated to a program (which, more or less, is just a map of which virtual addresses a program is alloed to access) and physical memory. The allocation of the former was described in another thread started by yourself. The latter is done demand-based: i.e. a process tries to access a virtual address it is allowed to access and the kernel then allocates and assigns a physical memory area for it.

You will be better off trying to find a book on virtual memory design.

--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
.



Relevant Pages

  • Re: virtual memory
    ... you can have virtual memory ... that software transparent swapping requires virtual memory. ... (since swapping it into physical memory is all or nothing). ...
    (comp.arch.embedded)
  • Re: Why is VS 2005 so slow?
    ... You are confusing physical memory with virtual memory. ... Note also that the number of apps you can run at the same time doesn't change. ...
    (microsoft.public.vc.mfc)
  • Re: Relocating application architecture and compiler support
    ... > then that is just virtual memory support. ... it wasn't virtual memory in the conventional sense. ... memory you could have addresses larger than physical memory that were mapped ... the base register was invisible to the program. ...
    (comp.arch.embedded)
  • Re: Is there a maximum contiguous memory allocation?
    ... if you have enough virtual memory. ... physical memory is zero. ... Win64 has a 2GB Limit? ...
    (microsoft.public.vc.mfc)
  • Re: Is there a maximum contiguous memory allocation?
    ... if you have enough virtual memory. ... physical memory is zero. ... contiguous arrays to minimize page faults (the extra cost ...
    (microsoft.public.vc.mfc)