我阅读了有关内存分配过程中的以下行:内存分配过程
One of the important considerations in main memory management is: how should an
OS allocate a chunk of main memory required by a process. One simple approach
would be to somehow create partitions and then different processes could
reside in different partitions.
注意,本款寻呼的概念之前来了,在一次谈论内存分配全过程。 我的问题是:
Why should we create partitions? We can just keep track of holes in the memory
and keep pointers to the beginning and end of the holes. When we allocate a
process some memory, we can associate the pointer to the beginning and end of
the process with the process and end pointer of the process serves as the
pointer to the beginning of a new hole.
@sirgeorge ...请注意,我正在讨论连续分配内存给进程。因此,如果每个第二个字节是一个空洞,那么意味着每个进程都是1个字节长。我认为我们可以认为,如果分区中遗漏的空洞可能被另一个进程完全或部分占用。例如:如果有一个256字节的分区,并且有一个100字节的进程。现在,如果有50字节的进程出现,它可以占据与100字节相邻的地方(所以我们需要一个指针告诉我们100字节进程的结束)。所以,为什么涉及分区时指针可以照顾它呢? – avinash