Developer Guide

  • 10/27/2020
  • Public Content
Contents

Memory Management

This page provides guidelines for managing memory in your applet. For details on the memory capabilities of the Intel® DAL environment, see Memory.
The following are some of the memory-related design considerations:
  • The VM does not handle fragmentation in the memory. This means that allocating and de-allocating a large number of small sized memory chunks might lead to the situation where a memory request will not be honored because of the lack of a contiguous block of suitable size even though the amount of memory is available. Thus it is advisable to allocate larger needed chunks of memory first.
  • In general, due to heap fragmentation, it is recommended to add ~40% to the estimated trusted application heap usage from the amount measured in profiling and use that larger value as a manifest parameter.
  • For the above reason trying to allocate a large buffer (e.g. for encryption or transmission) may fail while allocating a number of smaller buffers, even with the same total size, may succeed.
  • It is recommended to let the garbage collector handle the memory that you are not using, i.e., don’t save, as members of the class, memory that you don’t need to.
  • When the applet runs out of memory,
    OutOfMemoryError
    should be thrown, to allow the applet to recover properly (i.e., to release unused memory). Note that there are cases when
    OutOfMemoryError
    should be thrown but there is not enough memory to allocate the error. If this happens, the session with the applet is terminated and the host application receives an
    APPLET_FATAL
    error.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.