what is "commit storage" any way?
-
in the fifth edition of Windows via C/C++(written by Jeffery Richter) in many places i saw this phrase "commit storage", for example in Chapter 17, section "Memory-Mapped Executables and Dlls", there is this note: " When a process is loaded, the system examines all the file image's pages. The system commits storage in the paging file immediately for pages that would normally be protected with the copy-on-write attribute. These pages are simply committed; they are not touched in any way. When a page in the file image is accessed, the system loads the appropriate page. If that page is never modified, it can be discarded from memory and reloaded when necessary. If the file's page is modified, however, the system swaps the modified page to one of the previously committed pages in the paging file." what does he mean by "commit storage"? What if a page is committed? What does the system do to commit a page? what does this sentence mean "If the file's page is modified, however, the system swaps the modified page to one of the previously committed pages in the paging file." Can somebody help me? Thanks! Jack
-
in the fifth edition of Windows via C/C++(written by Jeffery Richter) in many places i saw this phrase "commit storage", for example in Chapter 17, section "Memory-Mapped Executables and Dlls", there is this note: " When a process is loaded, the system examines all the file image's pages. The system commits storage in the paging file immediately for pages that would normally be protected with the copy-on-write attribute. These pages are simply committed; they are not touched in any way. When a page in the file image is accessed, the system loads the appropriate page. If that page is never modified, it can be discarded from memory and reloaded when necessary. If the file's page is modified, however, the system swaps the modified page to one of the previously committed pages in the paging file." what does he mean by "commit storage"? What if a page is committed? What does the system do to commit a page? what does this sentence mean "If the file's page is modified, however, the system swaps the modified page to one of the previously committed pages in the paging file." Can somebody help me? Thanks! Jack
Committed means the memory that is ready for use. It's at the disposal.
JackPuppy wrote:
When a page in the file image is accessed, the system loads the appropriate page. If that page is never modified, it can be discarded from memory and reloaded when necessary.
You should know about Paging to understand these terminologies. That's Bascically about maintaining virtual memory. To trick your process to believe it's got 2GB of address at it's disposal. You might have heard every process in windows is allocated a virtual memory of 2GB for userspace. But they are "virtual". Even you have just 512 KB of virtual memory, your process can use upto 2GB - because of memory gets mapped to virtual memory. Here the chunks of memory are termed as "pages". In the quoted text, what it means is that, until a specific page from your application is not required, it's not loaded into memory. And the pages that the OS predicts to be required would be kept in the page file (VM). If the application searches for a page that is not found the the physical memory(RAM), it searches the page files table & loads the required page. And if the phyiscal memory is full, it does a swapping based on some page replacement algorithms. Ok enough of the story, Search for "Paging" &"virtual memory". May be you can add "win32" if are specific about the OS implementation. byebye.:thumbsup:
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
-
Committed means the memory that is ready for use. It's at the disposal.
JackPuppy wrote:
When a page in the file image is accessed, the system loads the appropriate page. If that page is never modified, it can be discarded from memory and reloaded when necessary.
You should know about Paging to understand these terminologies. That's Bascically about maintaining virtual memory. To trick your process to believe it's got 2GB of address at it's disposal. You might have heard every process in windows is allocated a virtual memory of 2GB for userspace. But they are "virtual". Even you have just 512 KB of virtual memory, your process can use upto 2GB - because of memory gets mapped to virtual memory. Here the chunks of memory are termed as "pages". In the quoted text, what it means is that, until a specific page from your application is not required, it's not loaded into memory. And the pages that the OS predicts to be required would be kept in the page file (VM). If the application searches for a page that is not found the the physical memory(RAM), it searches the page files table & loads the required page. And if the phyiscal memory is full, it does a swapping based on some page replacement algorithms. Ok enough of the story, Search for "Paging" &"virtual memory". May be you can add "win32" if are specific about the OS implementation. byebye.:thumbsup:
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
Wow, thanks, a great answer. After my searching and reading, it should be pointed out that if the application searches for a page that is not found in the RAM, sometimes it will search for exe/dll file somewhere in disk other than page file,for example when the exe/dll file mapped into process address without relocation-that means it doesn't need page files to store relacated pages. Thanks for your kind!