Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

What is the maximum available memory of the enclave?

enclave_Research
1,761 Views

What is the maximum available memory of the enclave? How much should I set the stack and heap so that the enclave can encapsulate the maximum data?

0 Kudos
1 Solution
JesusG_Intel
Moderator
1,506 Views

Hello enclave_research,


You are requesting to allocate 32 GB to each of the heap and stack and that is causing memory issues because, I suspect, you don't have that much RAM. On my system, it compiles very slowly and errors out at runtime with SGX_OUT_OF_MEMORY. Try allocating less memory so that it at least fits into your available RAM and you still have room for other processes to run.


Sincerely,

Jesus G.

Intel Customer Support


View solution in original post

0 Kudos
7 Replies
X99
New Contributor I
1,723 Views

The best answer is "it depends". Legacy CPU supporting SGX were limited to 128 or 256Mbytes, but Intel recently increased this limit...dramatically...up to 1Tbyte. Intel's ARK CPU pages might help.

enclave_Research
1,718 Views

When compiling enclaves, if the requested memory exceeds 64G, it will prompt that the requested memory is too large and the compilation fails.Why?

0 Kudos
JesusG_Intel
Moderator
1,673 Views

Hello enclave_research,


Ensure you have configured your project to compile as x64. If this doesn't work, send us more details including source code, makefiles, Visual Studio sln, etc, so we can reproduce your issue.


Have you tested your problematic code snippet as a separate test program outside of the enclave to ensure that it can compile?


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
JesusG_Intel
Moderator
1,617 Views

Hello enclave_research,


Do you still need help with this issue?


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
enclave_Research
1,563 Views

I compile example SealUnseal on the Ubuntu server,Other codes remain unchanged,but Enclave_Seal.config.xml is:

<StackMaxSize>0x7ffc00000</StackMaxSize>

    <HeapMaxSize>0x7ffc00000</HeapMaxSize>

    <TCSNum>1</TCSNum>

0 Kudos
JesusG_Intel
Moderator
1,507 Views

Hello enclave_research,


You are requesting to allocate 32 GB to each of the heap and stack and that is causing memory issues because, I suspect, you don't have that much RAM. On my system, it compiles very slowly and errors out at runtime with SGX_OUT_OF_MEMORY. Try allocating less memory so that it at least fits into your available RAM and you still have room for other processes to run.


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
JesusG_Intel
Moderator
1,500 Views

Hello enclave_research,


Refer to section Enclave Memory Measurement Tool in the SGX Linux Developer Reference Guide to learn how to use sgx-gdb and sgx_emmt to help determine how much stach and heap to allocate to your enclave based on how much memory the enclave uses.


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
Reply