title: Are Arrays Contiguous in *Physical* Memory?
body: <p>I know that array elements are contiguous in virtual memory for sure, but are they in terms of <strong>physical</strong> memory like this one?</p>
  <pre><code>#define N 100*1024*1024
  int arr[N];
  </code></pre>
  <hr />
  <p><strong>Please Note, Until now most of you said the answer is NO but again my main question is the one below in bold.</strong></p>
  <hr />
  <p><strong>If not, at-least if one element was found in a page then can I suppose the whole page is filled of array elements</strong> (in other words they may not be contiguous as one in different pages but contiguous in each single page thus improving performance when reading 1 element we read a full page of nearby element ie 4096 byte instead of reading another page for next elements)?</p>
  <p>If yes, what if I tried to allocate a big array where there is no available contiguous physical memory (which can happen a lot I believe)?</p>
  <p><strong>If the answer depends on programming language I'm interested in C and C++ and if it depends on the OS I'm interested in linux and it's variants like ubuntu</strong></p>