- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I set HeapMaxSize equal to 0x80000 (512KB) for an enclave that needs 65KB of memory. However, SGX driver allocates 1030 EPC pages to this enclave. My question is that why the number of allocated pages is more than the enclave's requirement? and how is the size of allocated pages more than the max heap size? What I am missing here?
-M
<HeapMaxSize>0x80000</HeapMaxSize>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Meysam,
You should minimize the number of Trusted Threads via the TCSNum parameter in your enclave config file. This will impact your memory usage significantly as your total allocation for stack is TCSNum * StackMaxSize. There are no other memory optimization techniques you can do at the enclave config level.
Regards,
Jesus
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Meysam,
Please see this document for more info on Enclave memory footprint: https://caslab.csl.yale.edu/workshops/hasp2016/HASP16-17.pdf. See Page 2-Figure 1 and page 4, section 5.1, Figure 4.
The Enclave's memory footprint includes the Thread Context, Enclave Heap, and Enclave Code.
Regards,
Jesus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jesus,
thanks for your comment.
I have a sensitive block of data which is 256 pages. I set my heap address a little bit more than this and the stack part is also 60 pages. I want this enclave to occupy the smallest amount of memory in the EPC. For example, I want to keep the code out of EPC. Is it possible to do so? to this end, what change I should apply to my EDL file.
Thanks for your attention.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Meysam,
It is not possible to store enclave code outside of the EPC. Is there any code in your enclave that can be moved to to your app?
Regards,
Jesus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I appreciate your time and comment, especially your very prompt reply.
In my EDL file, I defined 4 functions which are accessing the sensitive blocks of data. I don't think I can pull them out of the enclave right? I reduce the stack and heap size and it reduced the size of EPC efficiently. So according to what you said, I can't shrink the EPC part of my enclave more than that?
-M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Meysam,
You should minimize the number of Trusted Threads via the TCSNum parameter in your enclave config file. This will impact your memory usage significantly as your total allocation for stack is TCSNum * StackMaxSize. There are no other memory optimization techniques you can do at the enclave config level.
Regards,
Jesus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Jesus,
yes, it worked. It reduced the number of EPC pages for my enclave significantly.
I appreciate your timely help.
-Meysam
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page