JAVA - Out of Memory
-
Our server installation has crashed twice so far in the past week due to this:
ERROR 2017-08-01T15:52:21,362 (com.serotonin.m2m2.rt.maint.BackgroundProcessing$RejectableWorkItemRunnable.run:559) - Error in work item java.lang.OutOfMemoryError: Java heap space
Version: core 3.1.1+20170620163725 (Build number: 20170620163725) - Enterprise
We used to run it with 2GB without any problems, but since we have the available memory I've increased it to 4GB from now on.
What's the permanent way to increase java memory size?
Is this the method I should?
-
Hi mihai,
Arguments to control the heap size are passed in the ext-available scripts. You probably want a script like....
#!/bin/bash case "$1" in init) # Startup with Java Memory setup for Large installation JAVAOPTS="$JAVAOPTS -Xms3200m -Xmx3200m" ;; esac
if you're only running Mango on that machine. Place it in ext-enabled.
Did anything change in the configuration recently?
-
There was one major change, which was the upgrade to 3.0.
So I've created a symbolic link as in my original post, since I noticed that it's essentially the same instructions that you gave.
How can I confirm that the changes worked?
-
You can see if the JVM has the arguments by doing a
ps $(pidof java)
at the command line. If you've passed the argument there, Java got it. You should also see it reflected on the internal metrics page. -
I've been away for two weeks but we haven't had any more crashes since increasing the heap size. Thank you.
-
Glad to hear it!
-
Old thread I know, but I've been having this same issue on a RPi installation.
I hard set the memory and I think it might have fixed the issue.Cheers
Dan