Error Java Heap Size(maxmemory set at 16gb)

Hello, I’ve been having this error for sometime now when i open one of my windows. i will try to be as detailed as possible so please read on. and thanks in advance

I press a push button to open a new window should open. using following script, to pass two values to the new window.

  param1 = event.source.parent.getComponent('Power Table 1').runid
     param2 = event.source.parent.getComponent('Power Table 1').lineid
     linea=event.source.parent.getComponent('Power Table 1').linename

     if param1 == 0 : 
         system.gui.messageBox ("PLEASE SELECT A RUN FROM THE TABLE")
         if system.gui.confirm(u'ESTA ACCION VA A PRODUCIR PALLETS EN LA LINEA %s , DESEA CONTINUAR?' % linea, 'Confirm'):

              window = system.nav.swapTo('ProductionPallets/CreatePallettouch110118', {'runid' : param1 ,'lineid' : param2})

But it does not always work correctly, instead i get these 3 different scenarios scenarios are happening:

1- windows open correctly.
2- windows does not open at all, the client freezes for about 3-4 seconds, and then logs this error.

>Writing project to cache file C:\Users\Juan\.ignition\cache\\C0\CSJasmine.proj
Exception in thread "AWT-EventQueue-2" java.lang.OutOfMemoryError: Java heap space
	at java.lang.StringCoding$StringDecoder.decode(Unknown Source)
	at java.lang.StringCoding.decode(Unknown Source)
	at java.lang.StringCoding.decode(Unknown Source)
	at java.lang.String.<init>(Unknown Source)
	at Source)
	at org.python.core.Py.getStackTrace(
	at org.python.core.Py.displayException(
	at org.python.core.PyException.printStackTrace(
	at org.python.core.PyException.toString(
	at java.lang.Throwable.<init>(Unknown Source)
	at java.lang.Exception.<init>(Unknown Source)
	at com.inductiveautomation.ignition.common.script.JythonExecException.<init>(
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(
	at com.sun.proxy.$Proxy20.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

3 - I press button once more, after the Error in the other scenario shown above and the windows opens, but the following happens:

    1. It opens on the background(and layer index of that window is highest in client so it should never be in behind any window)
    2. the data on the window it's grey out, like on the image below. 

    3. There is no data being polled from the DB 
    4. The PowerTable Background color is supposed to be  Alternating White/Gray  but as shown all Gray. 
    5. Component next to label "SKU"  its supposed to show the selected value based on the Run ID: component above.

When the heap size error doesn’t occur the window works just fine. it has actually been working for a while with less occurrence until yesterday.

About this window and hardware information in case it’s related to the error:

   * It has multiple property bindings with sql. query set at Poll Rate Off, but they all execute when windows opens first time. (10 properties are bound like that) So running at least 10 Queries when window opens.
   * Pass in two properties as shown in script above from previous window.
   * Windows has 23 expressions bindings .
   * 3 Expression bindings have now(0) in them for different calculation. 
   * When window opens no other error in the log.
   * Client Memory 1gb, ( i can increase to more if needed)
   * Workstations running the Client in Windows, all have from 8GB  RAM and up to 16GB
   * Gateway in Server 2016, 64GB ram.  Ignition wrapper conf. set as below.

# Wrapper Java Properties
# Java Application
#  Locate the java binary on the system PATH:\Program Files\Java\jdk-10.0.1\bin\java.exe
#  Specify a specific java binary:
#set.JAVA_HOME=/java/path\Program Files\Java\jdk-10.0.1\bin\java.exe

# Tell the Wrapper to log the full generated Java command line.

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1

# Java Library Path (location of Wrapper.DLL or

# Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode.

# Java Additional Parameters,server=y,suspend=n,address=8000

# Initial Java Heap Size (in MB)

# Maximum Java Heap Size (in MB)

# Application parameters.  Add parameters as needed starting from 1


# Set this value to TRUE to allow ignition.conf to be reloaded when the JVM is restarted

Again thanks for the help.

The memory settings shown are for the gateway. You are running out of memory in the client. What are the client memory settings in the project properties? What does the memory usage graph look like in the client diagnostics windows?

Thanks for the quick response, like i mention please read on information it’s there.


Client Memory set at 1GB.



client in this workstation it’s in STAGING and has been update multiple times since last open.

clients on the other works stations, memeory usage it’s much less. Project Name : Jasmine

any other details let me know.

It’s not clear why that project uses so much more memory that the others, but it is. Based on the graph, it is occasionally hitting 1GB and therefore dying. Increase the client memory allotment.

Also consider adding the following to your native client launcher’s command line for this (or all) of your projects:

1 Like

i’ll try but i have been doing thins since 256MB increasing and not been solved.

and what does the code you provided do ? and where would it put it?

It switches the garbage collector to a better algorithm. It uses a bit more CPU time, but keeps memory usage lower, usually. The graph of memory usage, over a long enough time period, shows a steady increase until it approaches maximum, then a cleanup is done, and the graph starts climbing again. G1GC makes this happen faster, and cleans up more reliably. I’ve found that everything runs most efficiently if the trough of the graph is <50% of max, and the peak of the graph is <80% of max.

You put that setting on the command line in your desktop shortcut for the project, as created by the native client launcher for your platform.

1 Like