views:

46

answers:

1

Hi,

If I have a 2 GB ram and I have an 2 instances of an Object which is 1.5 GB each, the operating system will help and context switch the pages to and from harddisk.

What if I have 1 instances but is 3 GB. Can the same paging method breakdown this instances into 2 pages? Or will I encounter out-of-memory issue?

I will also like to apply the same question to other data structures beside object, will the paging page it as a whole, or will it break it into smaller units.

Thanks.

+6  A: 

The operating system has no concept of "Objects", only memory pages. Your object will be made up of many memory pages which the OS can swap in and out of real memory independently of each other. Page size varies with operating systems, but is typically 4K.

anon
Thanks for the answer!
DonnieKun