Search This Blog

Sunday 27 March 2016

Memory Structures


Buffer is a reserved area of RAM. This area is used to pre-fetch or preload data while processor busy with current data so that processor could process pre-fetched data immediately after current data process completed which would avoid lag caused by I/O operation. This process is called buffering.

Virtual memory is a concept to compensate insufficient RAM for running a process. There is a temporary space on hard disk called paging file, this will be used as virtual memory. When RAM is not sufficient to run a process, then virtual memory management of processor keeps data in paging file and treats paging files as if its a RAM.

Paging
Its good to have all the data required to execute a process in RAM, but this is not mandatory. What is mandatory is to have only the data required to execute a task within a process of multiple tasks. Therefore processor will try to get all the data required to execute a process from disk and if there is no enough RAM then process will get the data required to process a task and then again retrieve the data to process another task.. this will increase number of I/Os and impact performance but the process would not be failed. What if there is no enough RAM to process even a task then it will use the virtual memory.. i.e. it will keep all the required data for a task in a file called paging file in hard disk and split the data into equal chunks called pages, then get a page, process, flush and get another page... this is called Paging...  Then the question is how would this not impact performance.. of course it would not be as fast as having all the data in RAM but still its better than searing for data location in every I/O because processor now has to look in only one specific location called paging file.
 

No comments:

Post a Comment