cancel
Showing results for 
Search instead for 
Did you mean: 

Paging Memory

Former Member
0 Kudos

Hi,

What is the difference between paging memory and heap memory ? What is the meaning of memory paged out ? What is the importance of paging memory ?

Thanks

Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi,

Memory page is a term related to virtual memory. Virtual memory is an Operating system(OS) provided feature. All modern age programs ask the OS for a lot of memory(even though it doesn't need so much at that point, it sort of anticipate that I might need more in future). So, what happens is, the physical memory(RAM), finishes fast. When all available memory is allocated, OS can no longer run more programs. Because of that problem, OS developers came up with this rather clever idea of virtual memory. It allows you to dedicate a portion of your hard disk to be treated as RAM. That might sound strange, but remember a lot of memory often is allocated but is not used. OS has clever algorithms to page this less used / unused memory to the disk(remember access to RAM is faster than Disk), so that active area of the allocated memory stays in RAM.

Heap is a term for the memory location where JVM keeps all the objects(java objects created using the new operator). As I mentioned in the above section, each program requests a certain amount of memory to the OS. In case of Java , its the heap size that decides how much memory JVM(java) asks for. Heap is further divided by JVM and each piece is given to different objects created. When an object no longer has any reference to it, it gets marked for garbage collection. Then a garbage collector runs on a scheduled interval (it can also be forced through programs) and frees up the memory allocated for those garbage.

Hope that helps

cheers

danus

Answers (0)