title: Is heap memory per-process? (or) Common memory location shared by different processes?
body: <p>Every process can use heap memory to store and share data within the process. We have a rule in programming whenever we take some space in heap memory, we need to release it once job is done, else it leads to memory leaks.</p>
  
  <pre><code>int *pIntPtr = new int;
  .
  .
  .
  delete pIntPtr;
  </code></pre>
  
  <p>My question: Is heap memory per-process?</p>
  
  <p>If YES,</p>
  
  <blockquote>
    <p>then memory leak is possible only when a process is in running state.</p>
  </blockquote>
  
  <p>If NO,</p>
  
  <blockquote>
    <p>then it means OS is able to retain data in a memory somewhere. If so, is there a way to access this memory by another process. Also this may become a way for inter-process communication.</p>
  </blockquote>
  
  <p>I suppose answer to my question is YES. Please provide your valuable feedback.</p>