Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

What is the maximum available memory of the enclave?

enclave_Research
1,062 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
807 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

7 Replies
X99
New Contributor I
1,024 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,019 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?

JesusG_Intel
Moderator
974 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


JesusG_Intel
Moderator
918 Views

Hello enclave_research,


Do you still need help with this issue?


Sincerely,

Jesus G.

Intel Customer Support


enclave_Research
864 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>

JesusG_Intel
Moderator
808 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


JesusG_Intel
Moderator
801 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


Reply