Memory Modification for the Resin Server

  • Last update:April 24, 2026
  • Overview

    Version

    Resin Version

    Resin of V4.0.58 or later versions

    Application Scenario

    A Java Servlet runs within a web server and shares the same Java Virtual Machine (JVM) as the server. Class loading in the web server consumes memory in the permanent generation (PermGen), while Java application execution, such as retrieving report data and processing intermediate results, consumes heap memory. If the JVM runs out of memory, Out of Memory (OOM) errors may occur, for example, java.lang.OutOfMemoryError:PermGen space or java.lang.OutOfMemoryError:Java heap space.

    Function Description

    This document describes how to modify the memory settings of the Resin server.

    iconNote: 
    Since FineReport can only be deployed on Resin of V4.0.58 or later versions, the instructions in this document apply exclusively to these versions.

    Memory Setting Modification

    You (the admin) can modify the memory settings of Resin by editing the resin.xml file. You are advised to modify the following memory-related parameters.

    ParameterDescriptionRecommended Value

    -Xmx

    -Xmx defines the maximum memory size of the Java heap.

    It sets an upper limit for the Java heap. When the heap reaches the defined size, the JVM stops allocating new memory, and garbage collection is triggered.

    8 GB ≤ -Xmx ≤ 32 GB

    You can view the recommended on-heap memory size (the -Xmx value) in an inspection report in Health Inspection.

    -Xms

    -Xms defines the initial memory size of the Java heap.

    The JVM allocates memory of the defined size as soon as it starts.

    Equal to -Xmx

    -XX:MaxPermSize

    -XX:MaxPermSize defines the maximum size of the Permanent Generation (PermGen) memory space, a special memory region in the JVM where metadata about loaded classes, methods, and static variables is stored.

    Equal to 1/2 * -Xmx

    -XX:MaxDirectMemorySize

    -XX:MaxDirectMemorySize sets an upper limit for the direct memory allocated by Java NIO, which is a common form of off-heap memory.

    Since the direct memory is allocated from the native memory outside the Java heap, the direct memory size is not limited by the heap size.

    2 GB

    1. Go to Resin installation directory\bin and locate the resin.xml file.

    2. Open the resin.xml file with a text editor. Add the following block inside the <cluster id="app"> element to modify the memory setting.

    <server-default>
                   <jvm-arg>-Xms8192m</jvm-arg>
                   <jvm-arg>-Xmx8192m</jvm-arg>
                   <jvm-arg>-XX:MaxPermSize=2096m</jvm-arg>
                   <jvm-arg>-XX:MaxDirectMemorySize=2048m</jvm-arg>
    </server-default>

    3. Save and close the resin.xml file.

    4. Restart the Resin server for the modifications to take effect.

    Attachment List


    Theme: Deployment and Integration
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy