The following issues may occur in projects deployed in Tomcat containers.
An overflow error caused by insufficient memory is thrown: java.lang.OutOfMemoryError: Java heap space.
FineDataLink uses excessive memory.
The Tomcat backend prompts "Memory is over threshold."
You want to adjust the default memory size of Tomcat.
The server is under heavy load.
You can refer to this document to increase the memory allocated to the Tomcat server hosting the FineDataLink project.
To prevent out-of-memory errors, you need to enable disk caching appropriately and adjust server memory allocation based on actual conditions.
This article details how to adjust the Tomcat server memory.
This document introduces how to modify the memory configuration for Tomcat servers exclusively.
You are advised to modify the following memory-related parameters.
It specifies the maximum memory size of the Java heap.
When the limit is reached, the JVM will stop allocating memory, and the garbage collection (GC) will be triggered.
You are advised to set its value to be greater than 16 GB, but not exceeding 80% of the system memory.
You can view the recommended Xmx value in Health Inspection.
It specifies the initial memory size of the Java heap.
The JVM will allocate memory of this size upon startup.
It specifies the off-heap NIO memory size, which limits the maximum size of Direct Memory.
The allocation of Direct Memory is not constrained by the Java heap limits, as it uses native memory resources rather than the Java heap memory.
The recommended value is 2 GB (reference range: 2 GB to 4 GB).
The minimum is 2 GB. While there is no hard upper limit, the server memory capacity should be taken into consideration. Ensure that the memory used by FineDataLink (BIMax) does not exceed 7/8 of the server's available memory.
The following section describes how to modify the server memory for Tomcat started via a command line script such as startup.bat and startup.sh.
Linux Operating System
1. Enter Tomcat installation directory\bin. Find the setenv.sh file. If the file does not exist, create a setenv.sh file.
2. Open the setenv.sh file with a text editor. Add the following lines to the file.
JAVA_OPTS="$JAVA_OPTS -Xms51200M -Xmx51200M -Xmn12800m -Xss1024k"JAVA_OPTS="$JAVA_OPTS -XX:MaxDirectMemorySize=8g"JAVA_OPTS="$JAVA_OPTS -Dfineio.read_mem_limit=2"JAVA_OPTS="$JAVA_OPTS -Dfineio.write_mem_limit=1"
3. Save and close the setenv.sh file.
4. Restart the Tomcat server to apply changes. You can view real-time memory usage under Management System > Intelligent O&M > Load Management > Load Surveillance after logging in to the project (as the admin), as shown in the following figure.
Windows Operating System
1. Enter Tomcat installation directory\bin. Find the setenv.bat file. If the file does not exist, create a setenv.bat file.
2. Open the setenv.bat file with a text editor. Add the following lines to the file.
set JAVA_OPTS=%JAVA_OPTS% -Xms51200M -Xmx51200M -Xmn12800m -Xss1024kset JAVA_OPTS=%JAVA_OPTS% -XX:MaxDirectMemorySize=8gset JAVA_OPTS=%JAVA_OPTS% -Dfineio.read_mem_limit=2set JAVA_OPTS=%JAVA_OPTS% -Dfineio.write_mem_limit=1
The above configuration is for reference only. You can adjust the parameter values according to actual server conditions.
3. Save and close the setenv.bat file.
4. Restart the Tomcat server to apply changes.
You can view real-time memory usage under Management System > Intelligent O&M > Load Management > Load Surveillance after logging in to the project (as the admin), as shown in the following figure.
The following section describes how to modify the server memory for Tomcat started as a service (rather than via startup.bat or startup.sh).
This section uses Windows 10, Tomcat 8, and JDK 1.8 as the demonstration environment. (The steps may vary slightly across versions. Adjust them accordingly.)
Method One
1. Double-click the Tomcat icon in the system tray at the bottom right of the screen, click the Java tab, and adjust the values of Initial memory pool and Maximum memory pool.
The former is the initial memory, and the latter is the maximum memory. The maximum memory should not exceed 80% of the physical memory.
2. Restart Tomcat to apply changes after modification.
Method Two
1. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\Tomcat8\Parameters\Java in Registry Editor. (The path may vary slightly.) Modify values of JvmMs (the initial memory) and JvmMx (the maximum memory).
2. Restart Tomcat to apply changes.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy