Most of us have come across a scenario where in the Informatica service goes down frequently and we see java.lang.OutOfMemoryError in the logs. Today, we will understand what is the cause of this problem and how to fix it.
When ever a JAVA program is started, the Java Virtual Machine (JVM) allocates some memory from the OS to itself to perform all the required operations. A part of this memory is known as JAVA Heap space. Whenever the threads running under the JAVA program needs memory, they take it from the JAVA heap space and when the threads get executed successfully the memory is allocated back to the JAVA heap space.
Please note that the size of the JAVA heap space cannot be modified dynamically. Whenever the JAVA program runs the memory allocated to the JAVA heap size is the initial value assigned in the infaservice batch file.
Along the execution of the program this heap size value increases as per need and in case if the value required increase than the maximum value assigned in the infaservice batch file, the Informatica service goes down thereby generating the following error “java.lang.OutOfMemoryError: Java heap space”
To fix this issue we need to first increase the memory assigned to the JVM based upon which we increase the maximum value allocated to the Heap space.
To increase the memory assigned to the JVM please go to OS registry. You can use the regedit command on the windows run tool to open the registry editor and navigate to below path:
and then modify the JVMMaxMemory value.
By Default, the value is set at 512, you can set it to 1024. Please make sure you bring down the service before doing so.
After increasing this value, you need to edit the infaservice batch file and look for parameters Xms and Xmx.
Xms (start size of the heap) & Xmx (maximum size of heap). You only need to edit the Xmx size here.
By default, it is set to 128 MB, so you can change it to 256 MB.
Note: Whatever value is already there in the corresponding field it needs to be increased based upon maximum value assigned to JVM like in above case we assigned 1024 MB to JVM hence we can either set maximum heap size to 256 MB or 512 MB but not more than that. Please restart the service after making these changes.
I hope you will find this information useful. Thanks!