intel / intel/confidential-computing.sgx.sdk
Peak Heap Size never reaches Max Heap Size before enclave crashing
- Dominant language
- C++
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am currently struggling to push secrets in an SGX-based Key-Value Store.
When I fix HeapMaxSize to ` 0x100000 ` (1MB), I manage to get 7000 pushed secrets inside an enclave before it crashes, with this memory usage (got with sgx-emmt):
```
[Peak stack used]: 13 KB
[Peak heap used]: 1024 KB
[Peak reserved memory used]: 0 KB
```
Here, peak heap used reaches the Heap Max Size I have set.
However, when I fix it to ` 0x100000000 ` (4GB), , I barely improve storage capacity (8000 secrets) before enclave crashing with the following memory inspection result:
```
[Peak stack used]: 13 KB
[Peak heap used]: 1160 KB
[Peak reserved memory used]: 0 KB
```
The peak heap used is no way near than the 4GB I have set for HeapMaxSize.
I don't feel that HeapMaxSize help me to improve my storage capacity.
I cannot use SGX2 EDMM (because of Linux kernel) even if I have an SGX2 capable hardware, so I need to tackle this problem in another way.
Can you give me some insights ?
Thank you in advance
PS: I am using Ubuntu 20.0.4 with SDK 2.19
Contributor guide
Research direction
Start by reproducing the enclave crash with HeapMaxSize set to 0x100000 and 0x100000000, then inspect both runs with sgx-emmt. The payload names no source file or test entry point, so first identify the SDK component governing heap growth and the relevant Linux and SDK 2.19 constraints. Done means explaining why the larger limit does not increase capacity and documenting a supported workaround or required change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100