Java mem increase in openHABian

@mstormi
Would it be possible to upgrade (to Milestone, Snapshots or Releases) in the future without losing the RAM configuration, which is now in the openhab default folder? Maybe another option point at “openhab related” in openhabian? It is cool that Openhab at standard configuration does not need much RAM but when you do more or have special configurations, you need also more ram. That would be a cool new feature.
Keep up the good work!

I don’t get what you are talking about. What “RAM configuration” and what oh folder do you refer to?
If you need more RAM you need to exchange your hardware, don’t you.

I mean the maximal RAM usage, which Openhab is allowed to use. That this config can be edited in Openhabian and stays saved after upgrades. For example a 4GB Raspi can use more RAM than a 512mb Raspi and some systems need a little bit more than the default config.

sudo nano /etc/default/openhab

standard:

EXTRA_JAVA_OPTS="-Xms192m -Xmx320m"

That’s not exactly what you think it is, and I haven’t encountered an OH installation yet that this setting would not be sufficient for (you would see OH crash spitting out of memory errors).
It does not get overwritten when you update the openhab package so if you believe you need to increase your setting just edit that file once.
Potentially way more harmful than of benefit if we wrapped that in menus.

Since JSS Binding this problem with heap space encountered when you execute a script with syntax errors.

Hm, this default folder does not get overwritten? That would be great. When I switched from 3.2 Release to 3.3 M1 I had to add it again.

When there’s a mem leak, no Java mem setting whatsoever will fix that so no point in changing settings.

It’s a file not a folder. I just did the same upgrade on my test system and it did not change that file. So yours is probably some edge case and as such there’s no need for a code change.

It does fixes the problem, because this binding just needs more ram in such a case. At some point it stops to need more ram but you can bump it up to 25% more ram usage than normal. (Respond from a JSS binding developer). For normal desktops or server no problem but for a Raspi setup it makes a difference.

Is my path correct:

sudo nano /etc/default/openhab

or do I need direct path to the file that it does not get overwritten?

Again I don’t understand you.
“sudo nano /etc/default/openhab” obviously is no path but a command to edit the file, and I don’t know what you mean by a “direct path” opposed to that. The filename /etc/default/openhab is correct.

I have had to increase this mostly due to the large number of image items I use. I’ve found that this HAS been reverted during some upgrades, and not with others. My last upgrade from 3.2.M3 (I think) to 3.2 stable kept my changes, but my jump from 3.1 to 3.2.M1 did not.

A cool feature to help with my memory use would be an auto scaling function for the image items. Since a large number of my image needs are used for preview and thumbnails, over half of my 4k images that get imported could immediately be scaled to VGA and save space. I’ve started trying to reduce my source images before importing them, but limited by time. and ability right now.

If not explicitly set (e.g. when for whatever reason the file is gone), Java will use default -Xms and -Xmx values that scale with the RAM in your machine. If you don’t experience out-of-memory, there is no need to mess with these settings. If you do, remove or set them yourself via /etc/default/openhab.