openhab-core: DSL-rules via UI cause "out of memory" errors (java heap space)

System (Proxmox VM):

stef@openhab3:~$ uname -a Linux openhab3 4.19.0-13-amd64 openhab/openhab-distro#1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

Openhab:

3.0.0 - Release Build

Java:

stef@openhab3:~$ java --version openjdk 11.0.9.1 2020-11-04 LTS OpenJDK Runtime Environment Zulu11.43+55-CA (build 11.0.9.1+1-LTS) OpenJDK 64-Bit Server VM Zulu11.43+55-CA (build 11.0.9.1+1-LTS, mixed mode)

Scenario: Migrating DSL-rules from OH2 to OH3 via the UI cause “out of memory issues” (java heap space). One can see, that those (easy) rules run extremely long (up to many seconds - seen in the rule status indicator in the UI or via the java processes top -H -p yourOH3javaProcess)

Solution: To get a stable OH3 instance i needed to put those rules in files again, like in OH2. Same rules, same trigger, no problems. Those rules run that fast then, that you can not even see the “running” state in the rule indicater.

See also https://community.openhab.org/t/openhab-3-openhabian-runs-out-of-memory-java-heap-space-errors-cpu-100-after-a-few-hours

An example rule was this:

rule "Wohnzimmerlicht"
when
    Time cron "0 0/5 * * * ?" or
    Item presence_wohnbereich received update
then
    if (presence_wohnbereich.state == ON) {
        if (now.hour >= 9 && group_light_wohnzimmer.state != ON && (lumen_wohnzimmer.state < 5 || now.isAfter((LokaleSonnendaten_Sonnenuntergang.state as DateTimeType).getZonedDateTime))) {
            sendCommand(group_light_wohnzimmer, ON)
        }
        else if (group_light_wohnzimmer.state == ON && lumen_wohnzimmer.state > 10) {
            sendCommand(group_light_wohnzimmer, OFF)
        }
    }
    else if (group_light_wohnzimmer.state != OFF) sendCommand(group_light_wohnzimmer, OFF)
end

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (5 by maintainers)

Most upvoted comments

I can confirm that this isn’t happening anymore in a current snapshot (tested 3.1.0~S2123).

image

Thanks anyone!