我閱讀了有關內存分配過程中的以下行:內存分配過程
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