Optimizing inline documents and impact on JVM memory

If you are typically processing documents of a relatively small size, you can improve the performance that is associated with the document transfer speed and storage space. To do so, implement the following LiveCycle product configurations:

  • Increase the default document maximum inline size for LiveCycle so that it is larger than the size of most documents.

  • For processing larger files, specify storage directories that are on a high-speed disk system or a RAM disk.

The maximum inline size and the storage directories (the LiveCycle temporary file directory and the GDS directory) are configured in the Administration Console.

Document size and maximum inline size

When a document that is sent for processing by LiveCycle is less than or equal to the default document maximum inline size, the document is stored on the server inline and the document is serialized as an Adobe Document object. Storing documents inline can have significant performance benefits. However, if you are using Process Management, the content may also be stored in the database for tracking purposes. Therefore, increasing the maximum inline size may affect the database size.

A document that is larger than the maximum inline size is stored on the local file system. The Adobe Document object that is transferred to and from the server is only a pointer to that file.

When document content is inlined (that is, less than the maximum inline size) the content is stored in the database as part of the document's serialization payload. Therefore, increasing the maximum inline size can affect the database size.

Change the maximum inline size

  1. In Administration Console, click Settings > Core System Settings > Configurations.

  2. Enter a value in the Default Document Max Inline Size box and click OK.

Note: The default maximum inline size is 65536 bytes.

JVM maximum heap size

An increase in the maximum inline size requires more memory for storing the serialized documents. Therefore, it generally also requires an increase in the JVM maximum heap size.

A heavily loaded system that is processing many documents can rapidly saturate the JVM heap memory. To avoid an OutOfMemoryError, increase the JVM maximum heap size by an amount corresponding to the size of the inline documents multiplied by the number of documents that are typically executed at any given time.

JVM maximum heap size increase = (inline documents size) x (average number of documents processed).

Calculating the JVM maximum heap size

In this example, the current JVM maximum heap is set to 512 MB and the maximum inline size is 64 KB. The server must be configured for the scenario where 10 jobs are run simultaneously, and each job has 9 input files and 1 result file (a total of 10 files per job and 100 files processed simultaneously). All the files are under 512 KB in size.

To store all the files inline, set the maximum inline size o at least 512 KB.

The required increase in the JVM maximum heap size is calculated using the following equation:

(512 KB) x (100) = 51200 KB, or 50 MB

The JVM maximum heap size must be increased by 50 MB for a total of 562 MB.

Considering heap fragmentation

Setting the size of inline documents to large values raises the risk of an OutOfMemoryError on systems that are prone to heap fragmentation. To store a document inline, the JVM heap memory must have sufficient contiguous space. Some operating systems, JVMs, and garbage collection algorithms are prone to heap fragmentation. Fragmentation decreases the amount of contiguous heap space and can lead to an OutOfMemoryError even when sufficient total free space exists.

For example, previous operations on the application server left the JVM heap in a fragmented state, and the garbage collector cannot compact the heap sufficiently to regain large blocks of free space. An OutOfMemoryError can occur even though the JVM maximum heap size was adjusted for an increase in maximum inline size.

To account for heap fragmentation, the inline document size must not be set higher than 0.1% of the total heap size. For example, a JVM maximum heap size of 512 MB can support a maximum inline size of 512 MB x 0.001 = 0.512 MB, or 512 KB.

// Ethnio survey code removed