#### Report Cache panel

The panel is displayed after you click Cache > Report Cache on the system toolbar of the JReport Administration page.

To improve performance, JReport Server enables you to cache reports and catalogs into memory so that they do not have to be loaded from disk when they are required. Note that when you run a report in Page Report Studio, the report and the catalog will not be cached.

See the panel.

Cache Loaded Catalogs

Specifies whether to keep a catalog in memory or to remove it from memory after a report has been generated.

Usually, after a report has been generated, the catalog used to generate it is removed from memory. However, if you specify this option, the catalog will be cached instead of being removed.

- Maximum Number of Catalogs to Be Cached
  Specifies the maximum number of catalogs that can be cached by the server in its memory. No more catalogs can be cached if this amount has been reached.
- Cached Catalogs
  Lists the currently cached catalogs.

  If you are using the Add button to add a catalog, the listed catalog item includes information such as catalog file path in the server resource tree and catalog version number. The format is as follows:<catalog file path>-V<version number>. The root path stand for the My Reports folder is `/USERFOLDERPATH/admin/`; the root path stand for the Public Reports folder is `/`.

  For the catalogs that are automatically cached by the server after the reports in them are run, the real paths of them are listed.

  - Add
    Adds a new catalog to the list of catalogs to be cached.
  - Remove
    Deletes the selected cached catalog.

Cache Loaded Reports

Specifies whether to keep the reports in memory or to remove them from memory after they have been generated.

- Maximum Number of Reports to Be Cached
  Specifies the maximum number of reports that can be cached in the memory by the server. No more reports can be cached if this amount has been reached.

  Each cached report will use some heap memory. If the heap is used up, an OutOfMemoryException will be thrown. In JRServer.bat/sh the -Xms setting specifies the initial heap and -Xmx specifies the maximum heap. For example, -Xms256m -Xmx1024m means that the initial heap is 256MB and the maximum heap is 1024MB. You can refer to the documents of the Java VM for more information.

  Here is an example, the accuracy depends on your OS and VM:

  Cache Size | Heap Size Required
  --- | ---
  10 reports | 16M
  30 reports | 25M

  The default cache size is 10 reports and the default maximum heap space is 1024MB. When you adjust the number, you should adjust the heap accordingly. The larger the heap space, the better the performance provided enough physical memory is available.

- Cached Reports
  Lists currently cached reports.

  If you are using the Add button to add a report, the listed report item includes information such as report file path in the server resource tree, report version number, and applied style name. The format is as follows: <report file path>-V<version number>(<applied style name>). When there is no style applied, the applied style name is None. The root path stand for the My Reports folder is `/USERFOLDERPATH/admin/`; the root path stand for the Public Reports folder is `/`.

  For the reports that are automatically cached by the server after they are run, the real paths of them are listed.

  - Add
    Adds new reports to the list to be cached.
  - Remove
    Deletes the selected cached reports.

Report Buffer Size for Sort Action

This option is not available to organization admin.

- System Managed Size
  Specifies whether to automatically control the buffer size used in the RAM for each report when sorting on page reports by system. If checked, all data for sorting will be stored in the RAM automatically.
- Custom Size
  Specifies to customize the buffer size used in the RAM for each report when sorting on page reports. The default value is 16 MB, and the minimum size required by JReport is 4 MB. Any value smaller than 4 MB will be ignored and use 4 MB instead, because if the amount of data for sorting is large (such as 5,000,000 records), but the buffer size that you configure is small, it will require a lot of IO and produce poor performance.

Note: Any change to the buffer size will take effect immediately.

Save

Applies the changes to JReport Server.