Top | Previous | Next |
Changing Memory Allocation for Ignition |
There are many reasons that a user may want to change the amount of memory that is allocated to Ignition. While most users find that the default memory allocation to be satisfactory, some may have solutions that require altering the max Java Heap size. Installations with subscriptions to several hundred thousand tags may find the default value of 1024MB to be too small. A system with a hundred different device connections may see its memory consumption increase quite a bit which in turn may negatively impact the performance of the system. Another scenario might include a memory constraint on the machine that Ignition is being installed and if the proposed solution is rather limited then the default 1024MB may be excessive; the initial heap size may also be too large.
Ignition makes these memory settings available for you to adjust to best fit your personal requirements. These settings are found in the ignition.conf file which is located: <INSTALL_DIRECTORY>Inductive Automation\Ignition\data (Windows installations) or /var/lib/ignition/data (default Linux installations)
Java Heap - A Quick Overview The Java Heap is basically just a chunk of memory that is used by a Java program during runtime. Memory from the heap is allocated whenever an object is created during the runtime execution of the Java program (this is a simplistic description but it is good enough for the purposes of this section). As objects are created by the Java program, memory is allocated to the heap. When objects are collected by the Java garbage collector after they are no longer in use, memory is released from the Java Heap.
In Ignition, things like SQLTags and device connections are objects that are created and stored in memory (or rather, pieces of them are stored). The more tags you drag into Ignition and the more device connections you create the more memory that is needed to keep track of everything. This memory is allocated to the Java Heap.
There is a limit to the amount of memory you can allocate to the heap if you are using 32 bit Java and Ignition. 32 bit Java will only allow you to specify a max heap size of 1536MB or less (in Windows systems). The limit imposed when using 64 bit java is extremely large and there shouldn't really be any concern about hitting this cap.
Changing the Heap Size Note: If you feel that you need to allocate more memory for Ignition to use then the first step would be to install the 64 bit version of Ignition along with 64 bit Java. 32 bit Java does not allow you to allocate more than 1536MB to the Java Heap space which really does not give you much of an increase in size. Systems that are expected to be large in terms of tag count should plan on being installed and run on a 64 bit machine.
How much memory is allowed to the Java Heap can be specified when a Java program is initially launched. There are two parameters that Ignition makes available to you to modify: wrapper.java.initmemory - This specifies the size to initially allow the Java Heap. wrapper.java.maxmemory - This specifies the maximum size that the Java Heap is allowed reach as it grows
Again, these settings are found in the ignition.conf file. You can edit this file with a normal text editor, however you will likely have to have administrator privileges to save the changes. In windows you can just right click the icon of the text editor you wish to use and select "Run as administrator ".
Once you have the file open:
*Note: Acceptable values are multiples of 8 (1024, 1536, etc). If 32 bit, do not increase this to anything larger than 1536
Ignition Service Will Not Start After Modifying Java Heap Space Settings If you run into the case where the Ignition service fails to start after you have adjusted the Java Heap space settings it merely means that you have likely allocated too much (or too little) memory. This is something that is common when adjusting the heap space settings on a 32-bit machine. While the upper limit on a 32-bit machine is 1536MB, sometimes the operating system won't be able to allocate this much contiguous space in memory. Just follow the steps from above and start lowering the memory incrementally (remember, multiples of 8) until the Ignition service is able to start and function normally. |