A Problem about MM - Minix
This is a discussion on A Problem about MM - Minix ; In page 280, it says :" When a process is created, it would be
allocated a block of memory. The block of memory will never be moved,
never be switched, never be increased, and never be decreased."
Question 1: Can ...
-
A Problem about MM
In page 280, it says :" When a process is created, it would be
allocated a block of memory. The block of memory will never be moved,
never be switched, never be increased, and never be decreased."
Question 1: Can it run when the process would generate a lot of
dynamic data? (The quantity of dynamic data is larger than the
allocated memory)
Question 2: Are the length of allocated memory same when a process is
created? If not, what does MM allocating memory accord to?
-
Re: A Problem about MM
fly3123@163.com wrote:
> In page 280, it says :" When a process is created, it would be
> allocated a block of memory. The block of memory will never be moved,
> never be switched, never be increased, and never be decreased."
> Question 1: Can it run when the process would generate a lot of
> dynamic data? (The quantity of dynamic data is larger than the
> allocated memory)
Just free() and malloc() memory from this space as you need it.
> Question 2: Are the length of allocated memory same when a process is
> created? If not, what does MM allocating memory accord to?
>
This is determined by special numbersin the the executable's headers
-
Re: A Problem about MM
Hi, Segin:
I (fly3123@163.com) means that all the dynamic data are needed in
that time. It can't be free(). Can the process run? Can it use the
space which aren't allocated for it?
Thanks .
-
Re: A Problem about MM
Benjamin wrote:
> Hi, Segin:
> I (fly3123@163.com) means that all the dynamic data are needed in
> that time. It can't be free(). Can the process run? Can it use the
> space which aren't allocated for it?
> Thanks .
>
Try reading the source to MM. We don't have any virtual memory, so once
a program is loaded, it's memory allocation is fixed, even if the
program han't malloc()'d or free()'d any of it.
Yes, this space can be malloc()'d and then free()'d. I have actually
written code that does this; you appearantly haven't.