全部博文(7)
分类: LINUX
2012-08-08 00:28:54
Explain Virtual Memory. What is the TLB?
Virtual memory is very important because each program is gonna take
2 power 32 bytes of memory which 4GB and many programs doesnt use that
much of memory physically. So we have RAM which will map the addresses
to the physical address. So once a variable needs an address its gonna
look into the page table and will get the physical memory page to the
RAM. So pages will be going in and out and you feel that you have been
actually given 4GB which you dont know that it hasn't allocated. So its
gonna load only on demand into the virtual memory and its the memory
managers duty to avoid two processes or programs virtual memories to map
to the same physical address and there by corrupting each other
accidentally. Now coming to TLB, TLB is translation Lookaside Buffer,
Since we need to map the virtual address to physical address in the
disk, its gonna look in the TLB cache to see where the corresponding
physical address is present to the corresponding virtual address
requested by the process.
Confused...you can actually google them and study a bit architecture to brush up these internal details.
Physical memory is the amount of actual chip memory installed in the computer. Virtual memory describes the whole memory space available on the computer, which can be much greater than the physicall memory by utilizing storage outside of physical memory to extend the address space. Typically, virtual memory is implemented by using hard disk space to store parts of the memory space.
Consider the physical memory to be a window into the entire virtual memory space, that just happens to be loaded into the computers actual ram/dram chips at the time.
It gives applications the ability ot have a much larger memory space than is available in ram/sram/dram hardware.
[...disk...disk.....|loaded in ram|....disk...disk]
TLB, as stated, is a tool that caches translations of address space to the appropriate location that this address space is actually stored (ram, disk, etc). It saves on computational work to convert the virtual address space address (what the program uses) to the physical address - that the Operating System uses to then retrieve things from actual ram or from a specific location in a disk page file.
Someone could go on without sleep over this.
VM replaced partitioned memory in the old days. Why use memory when you're not using the data?
TLB(translation look-aside buffer) keeps a "cache" of virtual address-page frame translations.
- Jack on February 04, 2006