SignalK / signalk-server-java

DEPRECATED - see https://github.com/SignalK/signalk-java
Apache License 2.0
6 stars 9 forks source link

java.lang.OutOfMemoryError: Java heap space #34

Open ph1l opened 7 years ago

ph1l commented 7 years ago

long running server instance runs out of memory:

Exception in thread "hawtdispatch-DEFAULT-1" Exception in thread "hawtdispatch-DEFAULT-3" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.NullPointerException
        at org.fusesource.mqtt.client.CallbackConnection$7.run(CallbackConnection.java:414)
        at org.fusesource.hawtdispatch.transport.HeartBeatMonitor$3.run(HeartBeatMonitor.java:83)
        at org.fusesource.hawtdispatch.transport.HeartBeatMonitor$1.run(HeartBeatMonitor.java:62)
        at org.fusesource.hawtdispatch.internal.SerialDispatchQueue.run(SerialDispatchQueue.java:100)
        at org.fusesource.hawtdispatch.internal.pool.SimpleThread.run(SimpleThread.java:77)
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "hawtdispatch-DEFAULT-2" java.lang.OutOfMemoryError: Java heap space
rob42 commented 7 years ago

This can happen with Hawtio enabled, especially if you are running on a RPi. Hawtio uses quite a bit of ram when you are watching for a long time. I think the act of watching causes JMX or jolokia to hold onto all the messages etc, so they can be accessed. Best option is to run hawtio only on a PC and set a decent amount of java memory (-Xmx1024M). You can still use it on the RPi, as signalk-java will run the jolokia client when hawtio=false in the config. Then if you run the standalone version of hawtio you can connect remotely to the RPi. See hawtio site