Java Heap Size Issue

When starting the Ignition Gateway as a service, I kept running into a problem where the Java heap size on the JVM was too large and the service would crash and fail to start. I was able to work around this by editing the .conf file so that my heap size was 512MB instead of 1024. However, I am wondering how this will affect the performance of Ignition if at all. Does anybody have any pointers on this?

In general, as long as changes to heap size are reasonable (for your machine, operating system architecture, and environment) Ignition will either get better or the same performance from increased heap space. Note that limitations include:

  1. Version of Java installed/in use by the system. 32-bit Java can only address ~1.5gB of RAM.
  2. OS architecture - while they’re increasingly uncommon, a 32-bit OS will have similar hard max memory restrictions.
  3. System specs - whether a dedicated machine or a VM, dedicating, say, 7gB out of the 8gB physically installed to Java is going to cause you more problems, not fewer.
    If you have 8gB or more of RAM, then increasing the Ignition heap to 2gB max (or even 4) should be fine - but be wary of doing that if you’re also running, say, MySQL or MSSQL on the same machine; databases tend to consume as much memory as they possibly can.
1 Like

Ignition now nicely shows the heap size in the Status > Performance page of the gateway.

Perhaps you could share that info with us, so we can advise some settings? 512MB seems fairly low to me, but if you have a small project, it might be the best setting.

1 Like

I have several small projects, but one mid-size project which will definitely be increasing. I have begun making adjustments to the heap size with good results. If I run into issues I will reply to this thread.

Ok so it looks like sometimes I am pushing it a little too much with the object heap size. Sometimes I seem to hit the limit I imposed on the heap size which is causing some errors, and I cannot increase my max heap size to more than 768MB. I am going to need a larger heap size eventually as the size of my projects increase. These are my operating parameters.

Java, Ignition, and my OPC servers are all 32-bit. I am running Ignition on windows server 2012. I have 16Gb of RAM. I can attach the wrapper log info if needed.

The 16GB of RAM is utterly useless with 32-bit Java.

1 Like

Why? If you hit the limit, you'll have to increase it.

And Phil is correct, 32-bit software can only use a theoretical maximum of 4GB RAM, usually a bit lower. So 16 GB is useless.

My original post has the answer to your first question. JVM could not allocate 1024 MB of memory.

But I am not even approaching that theoretical Max of 4GB of RAM. I am using a max heap size of less than 1GB

But does that explain why I can’t even use 1 GB of Memory before the JVM fails?

You’re gonna have to look at the OS’s task manager to tell you what’s going on. What else is running on this server? Hopefully not your database.

Yes I do have my database running on this machine, but my memory usage is only 15%. Nothing unusual going on in the background.

Why not? If the DB and the Ignition project are relatively small, this should work fine, right?

The JVM has a limit of 1.5 GB on a 32 bit OS.

Yes but my problem is I cannot even get 1 GB out of it for the JVM

When you say “crash and fail to start” - where are you seeing crashing, and where are you seeing failed to start? Can you go to the wrapper.log file and either upload it or cut out the last few lines when it’s attempting to restart and post it here?

Ok maybe crashing is the wrong word but the JVM can’t get he memory it needs so it fails to start. I found that in the wrapper logs.

DEBUG | wrapper | 2018/06/01 15:34:37 | JVM started (PID=3724)
INFO | jvm 1 | 2018/06/01 15:34:37 | Error occurred during initialization of VM
INFO | jvm 1 | 2018/06/01 15:34:37 | Could not reserve enough space for 1048576KB object heap
DEBUG | wrapper | 2018/06/01 15:34:37 | JVM process exited with a code of 1, setting the wrapper exit code to 1.
DEBUG | wrapper | 2018/06/01 15:34:37 | 1: STATUS_WAIT_1 (0x1)
ERROR | wrapper | 2018/06/01 15:34:37 | JVM exited while loading the application.

These lines repeat five times( from a setting in the service properties) then exits with the following lines

FATAL | wrapper | 2018/06/01 15:34:59 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2018/06/01 15:34:59 | There may be a configuration problem: please check the logs.
DEBUG | wrapperp | 2018/06/01 15:34:59 | closing backend server.
STATUS | wrapper | 2018/06/01 15:34:59 | <-- Wrapper Stopped

Show your ignition.conf contents, please. And please use triple-back-ticks on a line before and a line after your paste so it’ll format nicely.

# Configuration files must begin with a line specifying the encoding
#  of the the file.

# Wrapper License Properties (Ignored by Community Edition)
# Professional and Standard Editions of the Wrapper require a valid
#  License Key to start.  Licenses can be purchased or a trial license
#  requested on the following pages:

# Include file problems can be debugged by removing the first '#'
#  from the following line:

# The Wrapper will look for either of the following optional files for a
#  valid License Key.  License Key properties can optionally be included
#  directly in this configuration file.
#include ./wrapper-license.conf

# The following property will output information about which License Key(s)
#  are being found, and can aid in resolving any licensing problems.

# Wrapper Localization
# Specify the locale which the Wrapper should use.  By default the system
#  locale is used.
#wrapper.lang=en_US # en_US or ja_JP

# Specify the location of the Wrapper's language resources.  If these are
#  missing, the Wrapper will default to the en_US locale.

# Wrapper Java Properties
# Java Application
#  Locate the java binary on the system PATH:
#  Specify a specific java binary:

# 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

# Wrapper Logging Properties
# Enables Debug output from the Wrapper.

# Format of output for the console.  (See docs for formats)

# Log Level for console output.  (See docs for log levels)

# Log file to use for wrapper output logging.

# Format of output for the log file.  (See docs for formats)

# Log Level for log file output.  (See docs for log levels)

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.

# Log Level for sys/event log output.  (See docs for log levels)

# Wrapper General Properties
# Allow for the use of non-contiguous numbered properties

# Title to use when running as a console
wrapper.console.title=Ignition Gateway

# Wrapper JVM Checks
# Detect DeadLocked Threads in the JVM. (Requires Standard Edition)

# Out Of Memory detection.
#wrapper.filter.message.1000=The JVM has run out of memory.


# Wrapper Email Notifications. (Requires Professional Edition)
# Common Event Email settings.<SMTP_Host>[%WRAPPER_HOSTNAME%:%WRAPPER_NAME%:%WRAPPER_EVENT_NAME%] Event Notification<Sender email><Recipient email>

# Configure the log attached to event emails.

# Enable specific event emails.

# Specify custom mail content JVM was restarted.\n\nPlease check on its status.\n

# Wrapper Windows NT/2000/XP Service Properties
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service

# Display name of the service
wrapper.displayname=Ignition Gateway

# Description of the service
wrapper.description=Ignition Gateway

# Service dependencies.  Add dependencies as needed starting from 1

# Mode in which the service is installed.  AUTO_START, DELAY_START or DEMAND_START

# Allow the service to interact with the desktop.


Huh. Looks just fine. You might just need to do a remote assistance session with IA support.

Thank for taking the time to look. Another small questions. Would turning off asynchronous read/write operations in a server configuration have the potential to cause read timeouts on tags?