title: Intel SGX HeapMaxSize and EPC page swapping
body: <p>The .edl files contain a <code>HeapMaxSize</code> entry. The SDK User Guide states that this is because</p>
  
  <blockquote>
    <p>Enclave memory is a limited resource. Maximum heap size is set at
    enclave creation.</p>
  </blockquote>
  
  <p>But doesn't the SGX specification allow EPC page swapping (EPA, EBLOCK, ETRACK, EWB)?</p>
  
  <p>Or in a more practical sense: is there a disadvantage to setting <code>HeapMaxSize=2^64</code> Bytes?</p>
  
  <p>Maybe EPC page swapping is not yet supported by the SDK, or maybe the trusted enclave code has to manually trigger such swapping?</p>
  
  <p><strong>Edit</strong>
  As <em>ab.</em> points out, with SGXv1 all EPC pages have to be <code>EADD</code>ed prior to enclave execution. Does the SDK at this point support only SGXv1 instructions?</p>