See Also: Low Memory Warning
The setting of Java Heap memory usage on FRP systems is not difficult but is very important. It is best if you read this entire article first before attempting to change your memory settings. We have divided this article into the following sections to aid you in finding specfic information if you are experienced with this subject.
Problem Description
Solution Outline
Monitoring Memory Usage On Your System
Troubleshooting Memory Issues
Setting Your Systems Maximum Java Heap Memory Usage
Example settings
NOTE: FRP versions previous to 6.5.X had a default maximum setting of 512mb for Java Heap Memory. Version 6.5.X and up now install with a default maximum of 1600mb.
Problem Description
Users that need to replicate a very large number of files per directory or have a setup of multiple and frequent jobs should consider changing the default memory allocation for FRP. Symptoms that can result from too little memory assigned to FRP processes are: Excessive time to complete jobs causing FRP to run beyond the scheduled window for the job, application freeze, high CPU usage, crashes, unexplained job aborts, FRP services stop responding to the job schedule.
Solution Outline
FRP memory consumption is highly effected by several factors. Some those factors are:
-
The number of files that exist in a directory subject to replication IE: 10,000 or more.
-
A large number of path lengths in excess of 128 char.
-
The number of jobs being run in total and in parallel.
-
Compression
-
Encryption
-
CRC checking
-
Real Time Replication
It should also be obvious that if you are restricted in how much memory you can assign to FRP, reducing the use of the items above will reduce FRP's need for memory.
Any of these issues or a combination of them can cause FRP to suffer from insufficient memory, therefore it is highly recommended to change the default memory usage. This is necessary only for the FRP Replication Service and not for the other two services: FRP Management and FRP Helper.
During installation, the FRP replication service is configured to use a maximum of 512MB. FRP is very efficient and does not require massive amounts of memory to accomplish a great deal of work. In most cases with only a few jobs and not too many other memory consuming demands, FRP does not need additional memory. The threshold for increasing memory to 1024MB or 2048MB (or something else) is very individual to your environment and the demands you place on FRP. As you can see from this process it is not difficult to make this change and you can reverse it just as easily.
Monitoring Memory Usage On Your System
You can monitor FRP's usage of memory in the log file /FileReplicationPro/logs/log_replication_server.txt
The default installation of FRP is set to use a maximum of 512 MB ram, below is a typical log entry of FRP's memory usage at the default level.
Memory Analysis (runtime)>> Allocated: 5056 kb >> Free: 1002 kb >> Max: 520256 kb
Below is an example of a normal memory usage log entry with the server set to use a maximum of 1024m of memory.
Memory Analysis (runtime)>> Allocated: 13288 kb >> Free: 4015 kb >> Max: 1040512 kb
Below is the setting in the /FileReplicationPro/FRPRep.lax file that enabled the above memory usage.
lax.nl.java.option.java.heap.size.max=1024m
Below is an illustration of the memory logging when the java heap size is set higher than the available memory on the machine or if the OS prevents the higher setting and defaults back to 64m which is too low for FRP to operate correctly. When this occurs you will need to reduce your java heap setting to a level that will be accepted by java. Read on for more information on this.
Memory Analysis (runtime)>> Allocated: 5056 kb >> Free: 3435 kb >> Max: 65088 kb
The /FileReplicationPro/FRPRep.properties (older versions of FRP use a .lax file) file was set as follows, however the operating system was windows 32 which limits the java heap to a max of 1600m due to OS limitations - even if more ram is available.
lax.nl.java.option.java.heap.size.max=3096m
Troubleshooting Memory Issues
There are limitations on how much ram can be assigned to the java heap that are imposed by java. The following article snippet helps to illustrate why in some cases placing the java heap setting too high will actually result in java rejecting the setting and falling all the way back to it's default of 64 MB which is usually too low to permit FRP to function well.
Please note that in the field regardless of what is said in the java-sun article quoted above, we have encountered some 64 bit machines / OSs that will not permit more than 1600m as the maximum java heap size. After you make a change and restart the FRPrep service check the memory in the logs for the correct result. If you observe that the log reports >> Max: 65088 kb then you have exceeded yours systems maximum java heap size and you will need to reduce it to something less. Remember as we have pointed out before for 32 bit systems the maximum you may be able to allocate is 1600m
Setting Your Systems Maximum Java Heap Memory Usage
Our examples below for each OS assume a modern machine with plenty of ram 4 GB or more. An example is provided for increasing FRP usage to 1GB, the exact change you will need to insert is highlighted in Green. In rare cases you may need to use even more memory such as 50+ jobs and or servers use more memory. To use more memory you can multiply 1024m to get more ram IE 1024 x 3 = 3096 which is 3GB of Ram. For those situations such as on Netware and MAC the Xmx1024M string needs to be multiplied in the same fashion. Be cautious about any change greater than 1600m, as some OS systems and hardware will not support larger java heap size settings and actually revert to 64m in operation. See the troubleshooting section above for more information on this issue.
To give you some idea of the impact of this change, we have seen Networks of 50 or more servers replicating very nicely on scheduled jobs with 1GB of ram assigned to FRP. We have also seen systems with 80 to 150 jobs running well with 2 to 3GB of ram assigned. Remember extras such as encryption, compression, real time etc. will add to these memory requirements.
----------------------------------------------------
For Windows, Unix and Linux servers:
For Windows server 2008 or any version that fails to take a memory change using the following method see Server 2008 Memory
Perform the following steps on both the SOURCE and DESTINATION replication servers:
This example demonstrates the setting to increase to 2GB of ram (from the default 1.6GB )
(1) Stop the FRP Replication Service.
(2) Using Notepad or any text editor, edit the file FRPRep.properties (older versions of FRP for windows use a .lax file) located in FRP home directory. Linux systems use a .lax file.
(3) Find the following line to and edit it to:
lax.nl.java.option.java.heap.size.max=2048m
(4) Save the file and exit the text editor.
(5) Restart the FRP Replication Service
----------------------------------------------------
For Netware Servers:
Perform the following steps on both the SOURCE and DESTINATION replication servers:
(1) Stop the FRP Replication Service.
(2) Using Notepad or any text editor, edit the file edit FRPRep.ncf located in FRP home directory.
(3) Add the following line to the end of file:
java -Xmx1024M
or
java -Xmx1G
On netware systems the syntax has been improved to permit the use of M for megabytes and G or gigabytes.
Or Edit the Xmx parameter for any other desired value
(4) Save the file and exit the text editor.
(5) Restart the FRP Replication Service
--------------------------------------------------
For a Mac Server:
Perform the following steps on both the SOURCE and DESTINATION replication servers:
(1) Stop the FRP Replication Service.
(2)Go to the FRP installation directory on the Mac and, right mouse click on executable, 'FRPRep'
(3)Choose 'Show package content' a new window will be opened.
FRP Version 6.5.2 and Prior use the following instructions. Version 6.5.3 and later versions use these instructions.
Go to 'Contents' folder and double click on 'Info.plist' file.
The file will be opened in the editor, scroll down to
'Java->Properties' section,
(4)You will create/edit new entry as shown below highlighted in Green and on older versions of FRP you will modify the -Xmx250M string to 1024. On newer versions of FRP you will add the <string>-Xmx1024M</string> if it is missing. Of course if you wish to allocate more memory than 1024MB (1GB) you can increase the size accordingly such 2048M to allocate 2 GB.
PLEASE Note that on earlier versions of FRP the <string>Djava.library.path=lib</string> will not exist and you DO NOT need to add it. If it exists, leave it as is.
You will make the following <string> insertion in the Info.plist file in the VMOptions section which is located at the bottom of the Info.plist file. Just add a new string items as shown below. Remember that older systems will not have (or need) the <string>Djava.library.path=lib</string> string.
<key>VMOptions</key>
<array>
<string>-Xms2M</string>
<string>-Xmx1024M</string>
<string>Djava.library.path=lib</string>
</array>
(5) Save the file and exit the text editor.
(6) Restart the FRP Replication Service
--------------------------------------------------
Yitzi 5-31-09
memory error replication fail