Developer Guide

  • 10/27/2020
  • Public Content
Contents

Heap Memory

Memory allocated for and by the trusted application at run time is also allocated from a pool of total heap memory for all trusted applications. Here too, decreasing the memory needed to be allocated will increase the possibility of running more trusted applications. It should be noted that this memory includes memory explicitly allocated by the trusted application as well as memory allocated by the System for use with the trusted application, such as stack memory, meta data and other memory needed by the System to support running the trusted application.
Trusted applications should not require a heap larger than 64K bytes. If the trusted application uses the UI interface then it may need a heap as large as 90K bytes. Decreasing the trusted application code memory footprint will increase the possibility of loading the trusted application when there are other trusted applications already loaded; further, a smaller trusted application will leave more room for other trusted applications.
The SDK in Intel® DAL provides memory profiling tools (built into the firmware emulators – see Determining Actual Memory Requirements for a Trusted Application) to measure the trusted application heap usage. Use the tools to run the entire end-to-end flow of the trusted application (causing the maximum memory usage) to determine the heap usage. Because of the potential of heap fragmentation, it is recommended to add 40% to the estimated trusted application heap usage and use that value as a manifest parameter. You can reduce the impact of fragmentation by allocating larger needed chunks of memory first. Let the garbage collector handle the memory that you are not using. Do not save anything you do not need to hang on to.
Tip:
In the Host - Trusted Application Communication flow, the buffer allocation for both Send and Receive operations is taken from the heap of the Trusted Application. In order to minimize the heap size needed, it is recommended not to use buffer sizes that are larger than a few kilobytes.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804