Expand Gateway Memory

Hi, I’m trying to expand the 2gb of memory of the gateway. I saw a few post where the recomended configuration is using G1GC. I copied a configuration from pturmel http://forum.inductiveautomation.com/t/gateway-java-question-7-7-2/10402
The problem is when I replace the configuration, Ignition doesn’t start again.

This is what I’m using:

# Java Additional Parameters
#wrapper.java.additional.1=-XX:PermSize=3076m
#wrapper.java.additional.2=-XX:MaxPermSize=4096m
wrapper.java.additional.1=-XX:+UseG1GC
wrapper.java.additional.2=-XX:MaxGCPauseMillis=100
#wrapper.java.additional.4=-Xincgc
wrapper.java.additional.3=-Xloggc:/var/log/ignition/javagc-%WRAPPER_TIME_YYYYMMDDHHIISS%.log
#wrapper.java.additional.4=-XX:+CMSClassUnloadingEnabled
#wrapper.java.additional.5=-XX:+CMSPermGenSweepingEnabled
wrapper.java.additional.4=-Ddata.dir=/var/lib/ignition/data
wrapper.java.additional.5=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
#wrapper.java.additional.8=-Xdebug
#wrapper.java.additional.9=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
wrapper.java.additional.6=-XX:+PrintGCDetails
wrapper.java.additional.7=-XX:+PrintGCTimeStamps
wrapper.java.additional.8=-XX:+PrintGCDateStamps
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=1536
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=3072

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=com.inductiveautomation.catapult.Catapult

wrapper.shutdown.timeout=120
wrapper.jvm_exit.timeout=120

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

The most likely cause is that Ignition’s trying to use 32-bit Java. Check the wrapper.log (/var/log/ignition/wrapper.log) and see why it’s failing.

STATUS | wrapper  | 2018/08/02 12:00:55 | --> Wrapper Started as Service
STATUS | wrapper  | 2018/08/02 12:00:55 | Java Service Wrapper Standard Edition 64-bit 3.5.35
STATUS | wrapper  | 2018/08/02 12:00:55 |   Copyright (C) 1999-2018 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper  | 2018/08/02 12:00:55 |     http://wrapper.tanukisoftware.com
STATUS | wrapper  | 2018/08/02 12:00:55 |   Licensed to Inductive Automation for Inductive Automation
STATUS | wrapper  | 2018/08/02 12:00:55 | 
STATUS | wrapper  | 2018/08/02 12:00:57 | Launching a JVM...
INFO   | jvm 1    | 2018/08/02 12:00:57 | WrapperManager: Initializing...
INFO   | jvm 1    | 2018/08/02 12:00:57 | java.io.FileNotFoundException: \var\lib\ignition\data\response (The system cannot find the path specified)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at java.io.RandomAccessFile.open0(Native Method)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at java.io.RandomAccessFile.open(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at java.io.RandomAccessFile.<init>(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at java.io.RandomAccessFile.<init>(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at com.inductiveautomation.catapult.CatapultRequestServer.<init>(CatapultRequestServer.java:37)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at com.inductiveautomation.catapult.Catapult.<init>(Catapult.java:83)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at com.inductiveautomation.catapult.Catapult.main(Catapult.java:60)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349)
INFO   | jvm 1    | 2018/08/02 12:00:57 | 	at java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2018/08/02 12:00:59 | Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file /var/log/ignition/javagc-20180802120055.log due to No such file or directory
INFO   | jvm 1    | 2018/08/02 12:00:59 | 
STATUS | wrapper  | 2018/08/02 12:00:59 | <-- Wrapper Stopped
WARN   | wrapper  | 2018/08/02 12:01:09 | Timed out waiting for wrapperServiceMain

Well, that’s weird. Can you try touch \var\lib\ignition\data\response? You may also want to comment out the GC logging statement from Ignition.conf, since that also seems to be failing.

I think the first question should be “Are you using Windows or Linux”, because that conf file is for linux. If he is using Windows, all of his paths must change accordingly.

Also, that isn’t a full config.

1 Like

yes, I’m using Windows, that’s why that folder path sound strange to me.
I have to change the path folders only? What other config I have to change?

You need to /var/lib to c:\path\to\ignition and /var/log to c:\path\to\ignition\log

1 Like

Did you original config have any paths specified? Copying Phil’s entire config verbatim without understanding what you’re doing is a bad idea.

The only options that have anything to do with memory already existed in your original config:

# Initial Java Heap Size (in MB)
wrapper.java.initmemory=256

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1024

and they aren’t part of the additional params section.

1 Like

It’s even documented in the manual:
https://docs.inductiveautomation.com/display/DOC79/Changing+Gateway+Memory+Allocation

1 Like

I want to use G1GC, because my project is for production purpose. I have 16gb of ram just for the gateway, I think the configuration is suitable for that amount of ram.

This happen when I changed the path:

STATUS | wrapper  | 2018/08/02 13:37:26 | --> Wrapper Started as Service
STATUS | wrapper  | 2018/08/02 13:37:26 | Java Service Wrapper Standard Edition 64-bit 3.5.35
STATUS | wrapper  | 2018/08/02 13:37:26 |   Copyright (C) 1999-2018 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper  | 2018/08/02 13:37:26 |     http://wrapper.tanukisoftware.com
STATUS | wrapper  | 2018/08/02 13:37:26 |   Licensed to Inductive Automation for Inductive Automation
STATUS | wrapper  | 2018/08/02 13:37:26 | 
ERROR  | wrapper  | 2018/08/02 13:37:27 | The value of property 'wrapper.java.additional.3', '-Xloggc:'C:\Program Files\Inductive Automation\Ignition\logs\javagc-20180802133725.log'' contains unquoted spaces and will most likely result in an invalid java command line.
ERROR  | wrapper  | 2018/08/02 13:37:27 | The value of property 'wrapper.java.additional.4', '-Ddata.dir='C:\Program Files\Inductive Automation\Ignition\data'' contains unquoted spaces and will most likely result in an invalid java command line.
STATUS | wrapper  | 2018/08/02 13:37:27 | Launching a JVM...
INFO   | jvm 1    | 2018/08/02 13:37:27 | Error: Could not find or load main class Files\Inductive
INFO   | jvm 1    | 2018/08/02 13:37:27 | Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file 'C:\Program due to Invalid argument
INFO   | jvm 1    | 2018/08/02 13:37:27 | 
ERROR  | wrapper  | 2018/08/02 13:37:27 | JVM exited while loading the application.
STATUS | wrapper  | 2018/08/02 13:37:32 | Reloading Wrapper configuration...
ERROR  | wrapper  | 2018/08/02 13:37:32 | The value of property 'wrapper.java.additional.3', '-Xloggc:'C:\Program Files\Inductive Automation\Ignition\logs\javagc-20180802133732.log'' contains unquoted spaces and will most likely result in an invalid java command line.
ERROR  | wrapper  | 2018/08/02 13:37:32 | The value of property 'wrapper.java.additional.4', '-Ddata.dir='C:\Program Files\Inductive Automation\Ignition\data'' contains unquoted spaces and will most likely result in an invalid java command line.
STATUS | wrapper  | 2018/08/02 13:37:33 | Launching a JVM...
INFO   | jvm 2    | 2018/08/02 13:37:33 | Error: Could not find or load main class Files\Inductive
INFO   | jvm 2    | 2018/08/02 13:37:33 | Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file 'C:\Program due to Invalid argument
INFO   | jvm 2    | 2018/08/02 13:37:33 | 
ERROR  | wrapper  | 2018/08/02 13:37:33 | JVM exited while loading the application.
STATUS | wrapper  | 2018/08/02 13:37:38 | Reloading Wrapper configuration...
ERROR  | wrapper  | 2018/08/02 13:37:38 | The value of property 'wrapper.java.additional.3', '-Xloggc:'C:\Program Files\Inductive Automation\Ignition\logs\javagc-20180802133738.log'' contains unquoted spaces and will most likely result in an invalid java command line.
ERROR  | wrapper  | 2018/08/02 13:37:38 | The value of property 'wrapper.java.additional.4', '-Ddata.dir='C:\Program Files\Inductive Automation\Ignition\data'' contains unquoted spaces and will most likely result in an invalid java command line.
STATUS | wrapper  | 2018/08/02 13:37:38 | Launching a JVM...
INFO   | jvm 3    | 2018/08/02 13:37:38 | Error: Could not find or load main class Files\Inductive
INFO   | jvm 3    | 2018/08/02 13:37:38 | Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file 'C:\Program due to Invalid argument
INFO   | jvm 3    | 2018/08/02 13:37:38 | 
ERROR  | wrapper  | 2018/08/02 13:37:38 | JVM exited while loading the application.
STATUS | wrapper  | 2018/08/02 13:37:43 | Reloading Wrapper configuration...
ERROR  | wrapper  | 2018/08/02 13:37:43 | The value of property 'wrapper.java.additional.3', '-Xloggc:'C:\Program Files\Inductive Automation\Ignition\logs\javagc-20180802133743.log'' contains unquoted spaces and will most likely result in an invalid java command line.
ERROR  | wrapper  | 2018/08/02 13:37:43 | The value of property 'wrapper.java.additional.4', '-Ddata.dir='C:\Program Files\Inductive Automation\Ignition\data'' contains unquoted spaces and will most likely result in an invalid java command line.
STATUS | wrapper  | 2018/08/02 13:37:43 | Launching a JVM...
INFO   | jvm 4    | 2018/08/02 13:37:44 | Error: Could not find or load main class Files\Inductive
INFO   | jvm 4    | 2018/08/02 13:37:44 | Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file 'C:\Program due to Invalid argument
INFO   | jvm 4    | 2018/08/02 13:37:44 | 
ERROR  | wrapper  | 2018/08/02 13:37:44 | JVM exited while loading the application.
STATUS | wrapper  | 2018/08/02 13:37:49 | Reloading Wrapper configuration...
ERROR  | wrapper  | 2018/08/02 13:37:49 | The value of property 'wrapper.java.additional.3', '-Xloggc:'C:\Program Files\Inductive Automation\Ignition\logs\javagc-20180802133749.log'' contains unquoted spaces and will most likely result in an invalid java command line.
ERROR  | wrapper  | 2018/08/02 13:37:49 | The value of property 'wrapper.java.additional.4', '-Ddata.dir='C:\Program Files\Inductive Automation\Ignition\data'' contains unquoted spaces and will most likely result in an invalid java command line.
STATUS | wrapper  | 2018/08/02 13:37:49 | Launching a JVM...
INFO   | jvm 5    | 2018/08/02 13:37:49 | Error: Could not find or load main class Files\Inductive
INFO   | jvm 5    | 2018/08/02 13:37:49 | Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file 'C:\Program due to Invalid argument
INFO   | jvm 5    | 2018/08/02 13:37:49 | 
ERROR  | wrapper  | 2018/08/02 13:37:49 | JVM exited while loading the application.
FATAL  | wrapper  | 2018/08/02 13:37:49 | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.
FATAL  | wrapper  | 2018/08/02 13:37:49 |   There may be a configuration problem: please check the logs.
STATUS | wrapper  | 2018/08/02 13:37:50 | <-- Wrapper Stopped

Wrap the path in double quotes.

1 Like

Thank you PGriffith, now is running. Do you think it would be good idea to increase to 4gb of ram? or 3gb is fine? Yesterday I was testing performance with multiple client open and with some Historical graphics with long time ranges and the memory reached 1500mb of 2000.