How to increase the amount of memory a PAM server can use
You can increase the dynamic (heap) memory that a PAM system will use for Windows or Linux Operating Systems, please see instructions below.
Information
PAM in the default configuration uses maximum 25% of all computer RAM for dynamic (heap) memory assuming that there might be other applications competing for the same memory. For example, if computer has 16 Gb of RAM, PAM will only use 4 Gb by default. If you think, you can give PAM more RAM there is a way to configure the max memory.
In the steps below, we make 8 Gb (8192 Mb) as the maximum amount of memory PAM can consume. You can set the max memory to whatever you desire using the below examples. Keep in mind that this max memory should allow other processes on the OS to work too that also includes other PAM components such as session manager or directory services.
If the system cannot allocate sufficient memory for the processes during startup, it will fail to start the service pammanager/PamManagement service.
The max memory setting to use requires some experimentation to ensure that the PAM Server has sufficient memory yet still allowing other processes to run on the same computer.
There are different steps that need to be taken to increase the maximum Java RAM for Linux and Windows.
There are a few settings that can be set, such as:
-
-Xms, which specifies the initial memory allocation pool
-
-Xmx, which specifies the maximum memory allocation pool for a Java virtual machine (JVM)
Note: We do not set an -Xms setting here, leaving the initial memory allocation pool as default and memory usage to grow.
The syntax options for the memory setting are shown in the examples below:
4GB |
-Xmx4096m -Xmx4g |
8GB |
-Xmx8192m -Xmx8g |
10GB | -Xmx10g |
24GB | -Xmx24g |
Linux
For example, to make max memory 8GB.
-
Create a file named setenv.sh in the $PAM_HOME/web/bin folder with the following content.
-
export CATALINA_OPTS="$CATALINA_OPTS -Xmx8192m"
-
-
Save the file.
-
Make its owner:group permissions the same as all other files in the folder, and make it executable
-
chmod +x setenv.sh
-
-
Restart the pammanager service.
-
Check in the log file that it used this parameter by observing the line like this one in the beginning after startup:
-
21-Dec-2020 14:55:32.657 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx8192m
-
Windows
On Windows, the PamManagement service needs to be modified to contain the new max memory setting. This is done by updating the ServiceManagement configuration file, then removing and again installing the PamManagement service. For example, to make max memory 8GB.
-
Stop the PamManagement service.
-
Make a copy of the $PAM_HOME\bin\ServiceManagement.cmd file and save this to a location outside of the PAM directory structure.
-
Edit the $PAM_HOME\bin\ServiceManagement.cmd file.
-
Locate the line that starts with @set JAVA_OPTS=%DERBY_OPTS%
-
Before the text -Dlog4j.configuration=, add the following:
-
-Xmx8192m
-
-
This should now read something like:
-
@set JAVA_OPTS=%DERBY_OPTS% -Xmx8192m -Dlog4j.configuration=file:/.......etc.
-
-
Save the ServiceManagement.cmd file.
-
Run the following two commands from a command prompt (running as Administrator)
-
Start the PamManagement service.
To verify the max memory has changed
-
Log into PAM and navigate to Management > About.
-
At the bottom of the page (Performance), view the Memory middle value.
-
Memory (total/max/free): 775,946,240 / 4,294,967,296 / 317,691,720.