Decrease Memory Usage by Immediately Freeing the Not Required Pages
Original Publication Date: 2002-Jul-13
Included in the Prior Art Database: 2003-Jun-21
Disclosed is the concept of reducing memory usage and also in distributing the I/O. Virtual memory manager (VMM) extends the logical address space by using part of the available secondary storage (such as hard disk etc.) to hold portions of the application and data that are not currently in physical memory. When an application needs to operate on a portion of memory that has been transferred to disk, the virtual memory manager loads this portion back into the physical memory. Virtual memory manager handles memory in a unit, which is called page (different systems have different page sizes) which generally are 4K. Whenever an application runs it requires memory. Memory is provided to the application from the logical pool as discussed above. These pages are kept in the memory (or in use and they are replaced from the memory using below given logic: 1) page has not been used for long time (it will be replaced by some demon according to page replacement algorithm), 2) above demon will be triggered if system falls low on memory. In order to free the page (memory) an I/O (if page has changed is started on them and whenever I/O is over the page (memory) becomes available. As shown above, page replacement is guided according to the memory demand and allows the unwanted pages (pages which can be freed to be in memory until the page replacement demon free those pages. The page replacement demon generally frees pages in group and due to which I/O's are not distributed and these unwanted pages (pages which could have been freed earlier add to the I/O. If we free these pages it will have two advantages: Memory can be used for a more useful purpose and I/O will be distributed. This can be achieved by providing a flag for the page. This flag will decide if the page can be immediately written and freed. When the above is set then I/O will be started on this page. This page becomes available (free) whenever I/O complete. This will help in low memory usage that is achieved as pages not required are then freed immediately, this results in low memory usage. Memory is then used more effectively. A distributed I/O is achieved because in ordder to free the page (if it has changed) an I/O is started, If pages are getting freed by a demon or when memory demand arises, then the I/O's will be started in a group and I/O will not be distributed. Normally, an application will run as follows: While running, an application is writing a large file (for example 1GB). This application will increase memory usage for the system, as file pages will reside in memory until VMM flushes those pages. This will cause heavy memory usage and sudden surge in I/O as I/O for the file pages will be sent in groups (whenever VMM page replacement starts). When reduced to practice and applied to the application, the application will use less memory and I/O will be distributed as follows: a) Set the above mentioned flag for file pages and b) as flag is set for file pages, I/O will be started on the pages and the pages will be freed whenever I/O completes. This will result in earlier freeing of file pages, memory usage will decrease, and I/O will be distributed.