Re: allocation of memory to a program
- From: Josef Moellers <josef.moellers@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 11:06:34 +0100
mohi wrote:
On Mar 28, 1:37 am, David Schwartz <dav...@xxxxxxxxxxxxx> wrote:On Mar 27, 1:07 pm, mohi <mohangupt...@xxxxxxxxx> wrote:
hello everyoneYour question doesn't really make sense. First, it's not clear whether
can anyone please tell we how the os kernel determines the size of
memory to be allocated
to a program while it is sheduled, here i mean how it determines the
size of the heap and the stack memory to be allocated to it .
all help is appreciated
moahn
it's about physical memory or virtual memory. Second, it implies that
memory is allocated when a process is scheduled, which is not the
case. Memory is allocated when the process requests it.
What are you trying to ask? It's not clear.
DS
sir ,
mean that 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.
Roughly speaking: there are four areas of memory a program is having allocated to it:
1. the pre-initialized areas that you find in the executable. This includes program code and pre-initialized data, e.g. character strings and explicitly initialized global variables).
2. the non-initialized data, i.e. global variables that are not assigned initial values
3. stack space for function local storage which is allocated implicitly.
4. memory explicitly allocated at runtime, e.g. by calling malloc().
The sizes of the first and second are held in the executable (use the "size" command to find out: "text" and "data" are the first, "bss" is the second). The third and fourth are determined during the program's runtime and may vary between invocations of the same program.
--
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
.
- References:
- allocation of memory to a program
- From: mohi
- Re: allocation of memory to a program
- From: David Schwartz
- Re: allocation of memory to a program
- From: mohi
- allocation of memory to a program
- Prev by Date: physical memory allocated to a program
- Next by Date: Re: physical memory allocated to a program
- Previous by thread: Re: allocation of memory to a program
- Next by thread: Re: allocation of memory to a program
- Index(es):
Relevant Pages
|