Mr Nice Guy auto allocation
Posted: Fri Aug 10, 2007 5:11 pm
In most operating systems that implement memory management, if you attempt to access memory at a location you haven't asked the os to set aside for you (allocate) you get some kind of fatal error.
My proposal is a system where accessing pages that haven't had the present bit set will automatically allocate a page inside of the page fault handler routine. But unlike pages that are allocated the politcally correct way (malloc for example) pages that are allocated to cover the mistakes of a ill designed userland program have a 2 bit timer in intervals of seconds so that after 3 seconds the page is set not present and ready to be used again. If a process gets memory leak happy and references way too many pointers that point to pages not allocated yet it will be terminated and the option to disable automatic allocating will be there for debugging.
Maybe if the default way for allocating pages was automatic (the application simply uses an address not allocated yet and the page is allocated) instead of having to make system calls it would be a possible performance gain or at least a simplified way to grant pages to programs.
My proposal is a system where accessing pages that haven't had the present bit set will automatically allocate a page inside of the page fault handler routine. But unlike pages that are allocated the politcally correct way (malloc for example) pages that are allocated to cover the mistakes of a ill designed userland program have a 2 bit timer in intervals of seconds so that after 3 seconds the page is set not present and ready to be used again. If a process gets memory leak happy and references way too many pointers that point to pages not allocated yet it will be terminated and the option to disable automatic allocating will be there for debugging.
Maybe if the default way for allocating pages was automatic (the application simply uses an address not allocated yet and the page is allocated) instead of having to make system calls it would be a possible performance gain or at least a simplified way to grant pages to programs.