Rules stop firing after a short while, stack trace in logs

Limiting the amount of RAM is going to make it more likely that you run into allocation errors, not less likely.

OH is memory hungry and the default is set to 512M for a reason.

But having said that, running OH on an RPi 1 is never going to give you adequate performance or a trouble-free install. It is simply too constrained. RPi 2s or better are really needed. So I would recommend getting that newer Pi (avoid the Pi Zeros as they are roughly the same specs as an RPi 1.

OK, looking at the stack trace I’ve no idea what is going on. I’ve never seen those errors before.

Looking at your rules I see some red flags.

  • 30 second Thread::sleeps are a huge red flag. Any sleep longer than 300 msec is to be avoided. The two minute sleeps are bound to cause you some trouble.
  • why are you using scripts for these? It isn’t like you will be reusing the script across multiple Rules. Using a script here is only going to cause OH to require more resources and add one more layer of redirection to get to and understand the code

Given the really long sleeps, I’m going to guess that the thread pool on your RPi 1 that is able to run Rules is really low and the long timers is causing it to run out. In fact, this would probably be a problem on ANY install, not just a RPi 1.

So I recommend:

  • instead of long sleeps use Timers
  • instead of scripts, put the code inline in your rules

Something like the following which uses the Expire binding to run your Timers:

New Item:

Switch Sonnenuntergang_Timer { expire="2m,command=OFF" }
rule "Voliere Sonnenuntergang"
when
    Time cron "0 15 21 1/1 * ? *"
then
    logInfo("Volierendimmer","Volierendimmer: Sonnenuntergang")
    Sonnenuntergang_Timer.sendCommand(OFF)
end

rule "Voliere Sonnenuntergang Timer"
when
    Item Sonnenuntergang_Timer received command OFF
then
    // calculate the new dimmer value
    var newDimmerValue = Volierendimmer.state as Number - 10
    if(newDimmerValue < 0) newDimmerValue = 0

    // log the value and send it to the light
    logInfo("Volierendimmer", "Volierendimmer Sonnenunterganng: " + FadeOutDimmer)
    Volierendimmer.sendCommand(newDimmerValue)

    // if the light is not yet at zero, reschedule the Timer
    if(newDimmerValue != 0) Sonnenuntergang_Timer.sendCommand(ON)
end

Implementing the other four is an exercise left to the student. I might recommend Reusable Functions: A simple lambda example with copious notes as a good place to start.