When your system has been running for a while you could make a heap dump and analyze where all the memory is consumed with Eclipse Memory Analyzer Tool (MAT). If you configure the runtime such that it will always write a heap dump on OutOfMemoryErrors (OOM) you can always analyze them after they just occurred. I am very interested in the results.
-
Create a heap dump from the console with the
dev:dump-createcommand. This may take several minutes when you run it on a Raspberry Pi. -
Try adding
EXTRA_JAVA_OPTS="-XX:+HeapDumpOnOutOfMemoryError"to your/etc/default/openhab2file to get automatic heap dumps in case of an error.
See also: