ZRAM issues

I use Zram and openhabian. But how do i change the size? I have log problems.
overlay2 588352 576064 0 100% /var/log

/dev/root 30400236 13814856 15319916 48% /
devtmpfs 494896 0 494896 0% /dev
tmpfs 499504 8 499496 1% /dev/shm
tmpfs 499504 57832 441672 12% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 499504 0 499504 0% /sys/fs/cgroup
overlay1 588352 3816 541528 1% /var/lib/openhab2
/dev/sda1 15121408 3104 15118304 1% /media/usb
/dev/mmcblk0p1 258096 52247 205849 21% /boot
/dev/zram1 588352 3816 541528 1% /opt/zram/zram1
/dev/zram2 588352 576064 0 100% /opt/zram/zram2
overlay2 588352 576064 0 100% /var/log
tmpfs 99900 0 99900 0% /run/user/1000

You can change size in /etc/ztab but that is the wrong approach as it’s wasting precious memory.
Have ZRAM rotate logs, check /etc/logrotate.d/00_oldlog and last 2 parameters in ztab

1 Like

After disabling Zram and again enabling Zram via the newly updated “openhabian-config”
the Ngix service fails on reboot

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-06-11 21:27:41 CEST; 7min ago
     Docs: man:nginx(8)
  Process: 638 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Jun 11 21:27:30 openhab systemd[1]: Starting A high performance web server and a reverse proxy server...
Jun 11 21:27:41 openhab nginx[638]: nginx: [emerg] open() "/var/log/nginx/access.log" failed (28: No space left on device)
Jun 11 21:27:41 openhab nginx[638]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 11 21:27:41 openhab systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jun 11 21:27:41 openhab systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 11 21:27:41 openhab systemd[1]: Failed to start A high performance web server and a reverse proxy server. 

See here;

nginx: [emerg] open() “/var/log/nginx/access.log” failed (28: No space left on device)

I Think there is a coherence with zram start sequence.
Because sudo service nginx restart works without errors. And I’m pretty sure that I’ve nothing changed but disable and re-enable the Zram feature

Any advises for me to fix this?

I’d think it’s started before zram and at that time, /var/log or rather the filesystem that is on (/ usually) and is/was out of space.
See bind_dir in ztab where the old (lower) filesystem can be accessed and clean up there.

I’ve added nginx to the list of programs to restart when /var/log is unmounted (you would need to re-install zram to benefit from that).

Now there is an error message, while enabling Zram via openhabian-config

There was an error or interruption during the execution of:  
        "30 | System Settings" 
           
     Please try again. If the error persists, please read    
     /opt/openhabian/docs/openhabian-DEBUG.md or 
      https://github.com/openhab/openhabian/blob/master/docs/openhabian-

and

**$ systemctl start zram-config**

**Warning:** The unit file, source configuration file or drop-ins of zram-config.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Job for zram-config.service failed because the control process exited with error code.

See "systemctl status zram-config.service" and "journalctl -xe" for details.

2020-06-12_10:19:14_CEST [openHABian] Checking for default openHABian username:password combination... OK

2020-06-12_10:19:14_CEST [openHABian] We hope you got what you came for! See you again soon ;)

EDIT: Switched back to "openHABian Configuration Tool [stable]v1.5-644(e01719a) " worked. Let’s see what ngix does after reboot

Can you set debugmode=maximum in /etc/openhabian.conf and re-run? Also get me the output of journalctl -xe please.

before I try this

first of all: Thank you for your quick response
second: what Version of the openhabian-config am I have to use?

master

[10:36:34] openhabian@openhab:~$ journalctl -xe
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.layout.TextEncoderHelper.encodeText(TextEncoderHelper.java:65)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encode(StringBuilderEncoder.java:68)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encode(StringBuilderEncoder.java:32)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:227)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:59)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:197)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:190)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:181)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.append(RollingRandomAccessFileAppender.java:252)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:543)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:502)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:485)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:412)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:154)
Jun 12 10:36:34 openhab karaf[640]:         at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog0(PaxLoggerImpl.java:354)
Jun 12 10:36:34 openhab karaf[640]:         at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog(PaxLoggerImpl.java:337)
Jun 12 10:36:34 openhab karaf[640]:         at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.inform(PaxLoggerImpl.java:149)
Jun 12 10:36:34 openhab karaf[640]:         at org.ops4j.pax.logging.internal.TrackingLogger.inform(TrackingLogger.java:120)
Jun 12 10:36:34 openhab karaf[640]:         at org.ops4j.pax.logging.slf4j.Slf4jLogger.info(Slf4jLogger.java:537)
Jun 12 10:36:34 openhab karaf[640]:         at org.eclipse.smarthome.io.monitor.internal.EventLogger.receive(EventLogger.java:53)
Jun 12 10:36:34 openhab karaf[640]:         at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155)
Jun 12 10:36:34 openhab karaf[640]:         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Jun 12 10:36:34 openhab karaf[640]:         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Jun 12 10:36:34 openhab karaf[640]:         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Jun 12 10:36:34 openhab karaf[640]:         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Jun 12 10:36:34 openhab karaf[640]:         at java.lang.Thread.run(Thread.java:748)
Jun 12 10:36:34 openhab karaf[640]: Caused by: java.io.IOException: Auf dem GerĂ€t ist kein Speicherplatz mehr verfĂŒgbar
Jun 12 10:36:34 openhab karaf[640]:         at java.io.RandomAccessFile.writeBytes(Native Method)
Jun 12 10:36:34 openhab karaf[640]:         at java.io.RandomAccessFile.write(RandomAccessFile.java:525)
Jun 12 10:36:34 openhab karaf[640]:         at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager.writeToDestination(RollingRandomAccessFileManager.java:137)
Jun 12 10:36:34 openhab karaf[640]:         ... 36 more
Jun 12 10:36:34 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:34 openhab rsyslogd[554]: action 'action-2-builtin:omfile' resumed (module 'builtin:omfile') [v8.1901.0 try https://www.rsyslog.com/e/2359 ]
Jun 12 10:36:37 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:37 openhab rsyslogd[554]: action 'action-2-builtin:omfile' resumed (module 'builtin:omfile') [v8.1901.0 try https://www.rsyslog.com/e/2359 ]
Jun 12 10:36:40 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:40 openhab rsyslogd[554]: action 'action-2-builtin:omfile' resumed (module 'builtin:omfile') [v8.1901.0 try https://www.rsyslog.com/e/2359 ]
Jun 12 10:36:42 openhab influxd[643]: [httpd] 127.0.0.1 - - [12/Jun/2020:10:36:42 +0200] "POST /write?db=telegraf HTTP/1.1" 401 55 "-" "Telegraf/1.14.4" d79c7b13-ac87-11ea-8009-dca632688824 116
Jun 12 10:36:42 openhab telegraf[637]: 2020-06-12T08:36:42Z E! [outputs.influxdb] When writing to [http://localhost:8086]: received error unable to parse authentication credentials; discarding points
Jun 12 10:36:43 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:43 openhab rsyslogd[554]: action 'action-2-builtin:omfile' resumed (module 'builtin:omfile') [v8.1901.0 try https://www.rsyslog.com/e/2359 ]
Jun 12 10:36:47 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:47 openhab rsyslogd[554]: action 'action-2-builtin:omfile' resumed (module 'builtin:omfile') [v8.1901.0 try https://www.rsyslog.com/e/2359 ]
Jun 12 10:36:49 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:49 openhab rsyslogd[554]: action 'action-2-builtin:omfile' resumed (module 'builtin:omfile') [v8.1901.0 try https://www.rsyslog.com/e/2359 ]
Jun 12 10:36:52 openhab influxd[643]: [httpd] 127.0.0.1 - - [12/Jun/2020:10:36:52 +0200] "POST /write?db=telegraf HTTP/1.1" 401 55 "-" "Telegraf/1.14.4" dd95429e-ac87-11ea-800a-dca632688824 116
Jun 12 10:36:52 openhab telegraf[637]: 2020-06-12T08:36:52Z E! [outputs.influxdb] When writing to [http://localhost:8086]: received error unable to parse authentication credentials; discarding points
Jun 12 10:36:52 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/2007 ]
Jun 12 10:36:52 openhab rsyslogd[554]: action 'action-2-builtin:omfile' suspended (module 'builtin:omfile'), next retry is Fri Jun 12 10:37:22 2020, retry nbr 0. There should be messages before this one giving the reason for suspension. [v8.1901.0 try https://www.rsyslog.com/e/200
Jun 12 10:37:02 openhab influxd[643]: [httpd] 127.0.0.1 - - [12/Jun/2020:10:37:02 +0200] "POST /write?db=telegraf HTTP/1.1" 401 55 "-" "Telegraf/1.14.4" e387a8a1-ac87-11ea-800b-dca632688824 126
Jun 12 10:37:02 openhab telegraf[637]: 2020-06-12T08:37:02Z E! [outputs.influxdb] When writing to [http://localhost:8086]: received error unable to parse authentication credentials; discarding points

Your / is still full. Free space there (but remember old /var/log is hidden unless you stop zram).

$ sudo systemctl status zram-config

**●** zram-config.service - zram-config

Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor preset: enabled)

Active: **active (exited)** since Fri 2020-06-12 10:34:32 CEST; 21min ago

Process: 328 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0/SUCCESS)

Main PID: 328 (code=exited, status=0/SUCCESS)

Jun 12 10:34:31 openhab zram-config[328]: mv: der Aufruf von stat fĂŒr '/usr/local/share/zram-config/zram-device-list.new' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: mv: der Aufruf von stat fĂŒr '/usr/local/share/zram-config/zram-device-list.new' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: stat: der Aufruf von stat fĂŒr 'stat' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: stat: der Aufruf von stat fĂŒr 'stat' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: stat: der Aufruf von stat fĂŒr 'stat' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: mv: der Aufruf von stat fĂŒr '/usr/local/share/zram-config/zram-device-list.new' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: stat: der Aufruf von stat fĂŒr 'stat' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: stat: der Aufruf von stat fĂŒr 'stat' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:31 openhab zram-config[328]: stat: der Aufruf von stat fĂŒr 'stat' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Jun 12 10:34:32 openhab systemd[1]: Started zram-config.

I tried reproducing and think it would happen with an old version of zram-config.
So replace yours with latest, append a -x to first line to get meaningful output nect time it is run.
Also check the log in /usr/local/share/zram-config/logs.
@Lars_R FYI, too.

What I did:

  1. followed your link and instructions
  • sudo apt-get install git
    
  • git clone https://github.com/StuartIanNaylor/zram-config
    
  • cd zram-config
    

manually append a -x in zram-config like this:

  • #! /bin/bash -x
    
  • sudo sh install.sh
    
  1. Installation performed without errors

  2. Rebooting the system sudo reboot

  3. Checked sudo systemctl status zram-config (no errors)

● zram-config.service - zram-config
Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2020-06-12 12:36:09 CEST; 2min 16s ago
Process: 352 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0/SUCCESS)
Main PID: 352 (code=exited, status=0/SUCCESS)

Jun 12 12:36:09 openhab zram-config[352]: + echo ‘log /zram1 /var/log /log.bind’
Jun 12 12:36:09 openhab zram-config[352]: + invoke-rc.d rsyslog restart
Jun 12 12:36:09 openhab zram-config[352]: + journalctl --flush
Jun 12 12:36:09 openhab zram-config[352]: + ‘[’ ‘!’ -z /opt/zram/oldlog ‘]’
Jun 12 12:36:09 openhab zram-config[352]: + echo ‘olddir /opt/zram/oldlog’
Jun 12 12:36:09 openhab zram-config[352]: + echo ‘createolddir 755 root root’
Jun 12 12:36:09 openhab zram-config[352]: + echo renamecopy
Jun 12 12:36:09 openhab zram-config[352]: + read -r line
Jun 12 12:36:09 openhab zram-config[352]: + ‘[’ false = true ‘]’
Jun 12 12:36:09 openhab systemd[1]: Started zram-config.

  1. Checked systemctl status nginx.service (with errors)

● nginx.service - A high performance web server and a reverse proxy server

Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)

Active: failed (Result: exit-code) since Fri 2020-06-12 12:36:25 CEST; 2min 57s ago

Docs: man:nginx(8)

Process: 627 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Jun 12 12:36:20 openhab systemd[1]: Starting A high performance web server and a reverse proxy server


Jun 12 12:36:21 openhab nginx[627]: nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (28: No space left on device)

Jun 12 12:36:25 openhab nginx[627]: 2020/06/12 12:36:21 [emerg] 627#627: open() “/var/log/nginx/access.log” failed (28: No space left on device)

Jun 12 12:36:25 openhab nginx[627]: nginx: configuration file /etc/nginx/nginx.conf test failed

Jun 12 12:36:25 openhab systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE

Jun 12 12:36:25 openhab systemd[1]: nginx.service: Failed with result ‘exit-code’.

Jun 12 12:36:25 openhab systemd[1]: Failed to start A high performance web server and a reverse proxy server

  1. checked zram-config.log (entries since start)

zram-config start 2020-06-12-12:36:08

ztab create swap lz4 250M 750M 75 0 80

insmod /lib/modules/4.19.118-v7l+/kernel/mm/zsmalloc.ko

insmod /lib/modules/4.19.118-v7l+/kernel/drivers/block/zram/zram.ko

zram0 created comp_algorithm=lz4 mem_limit=250M disksize=750M

Setting up swapspace version 1, size = 750 MiB (786427904 bytes)

LABEL=zram-config0, UUID=bde800a9-ae40-4472-8d7a-5fc3ac5de39c

swapon: /dev/zram0: found signature [pagesize=4096, signature=swap]

swapon: /dev/zram0: pagesize=4096, swapsize=786432000, devsize=786432000

swapon /dev/zram0

vm.page-cluster = 0

vm.swappiness = 80

ztab create log lz4 50M 150M /var/log /log.bind /opt/zram/oldlog

Warning: Stopping rsyslog.service, but it can still be activated by:

syslog.socket

dirPerm /var/log 755 0:0

mount: /var/log bound on /opt/zram/log.bind.

mount: /opt/zram/log.bind propagation flags changed.

dirMountOpt rw,noatime dirFsType ext4

zram1 created comp_algorithm=lz4 mem_limit=50M disksize=150M

mke2fs 1.44.5 (15-Dec-2018)

fs_types for mke2fs.conf resolution: ‘ext4’, ‘small’

Discarding device blocks: 4096/38400^H^H^H^H^H^H^H^H^H^H^H ^H^H^H^H^H^H^H^H^H^H^Hdone

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

38400 inodes, 38400 blocks

1920 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=39845888

2 block groups

32768 blocks per group, 32768 fragments per group

19200 inodes per group

Filesystem UUID: e24c059e-d7b7-4430-abd3-10a5954a021b

Superblock backups stored on blocks:

32768

Allocating group tables: 0/2^H^H^H ^H^H^Hdone

Writing inode tables: 0/2^H^H^H ^H^H^Hdone

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: 0/2^H^H^H ^H^H^Hdone

mount: /dev/zram1 mounted on /opt/zram/zram1.

mount: overlay1 mounted on /var/log.

By the time you run nginx start, /var/log is full. If ZRAM is off at that time, that is actually the same as / so you can delete other unneeded stuff from /, too.

So free space there! You still have not done that.
apt-cache clean or apt autoremove often help without doing harm.
Stop ZRAM before or delete older files from what is named as bind_dir for /var/log in ztab)

PS: you can also do journalctl -u zram-config or nginx

OK

  1. OK, I stopped zRam sudo service zram-config stop

  2. I cleared all the logs in /var/log with
    sudo find /var/log/ -type f -exec cp /dev/null {} \;
    which I found here https://serverfault.com/a/155301

  3. Reduced size of Journalctl via journald.conf wich was over 2GB
    https://got-tty.org/journalctl-via-journald-conf-die-loggroesse-definieren

  4. system reboot

  5. So far - so good - Everything (incl. ngix) works as expected

Thank you very much

I have the issue that all logging seems to stop after ~3 days on my RPi4 with 4GB of memory.

dmesg gives me plenty of errors for writting journal entries (i forgot to copy them before restarting).
zramctl looked ok and was nowhere near full.
df -h also didn’t show anything special.

what would be the best way to debug this?

How to ask a good question / Help Us Help You - Tutorials & Examples - openHAB Community

1 Like

Sorry for not being clearer and I hope this is not considered high jacking because the problem was mentioned here before

Today it happened again.
I’m trying to give as much useful information as possible but because all logging in the system essentially stops it is difficult. Please let me know if I missed something!

openhabian@openHAB:~ $ zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram1 lzo-rle 250M 240.6M 46.1M 120.9M 4 /opt/zram/zram1
/dev/zram0 lzo-rle 200M 12K 1.4K 8K 4 [SWAP]

openhabian@openHAB:~ $ cat /etc/ztab
# swap	alg		mem_limit	disk_size	swap_priority	page-cluster	swappiness
swap	lzo-rle		200M		600M		75		0		80

# dir	alg		mem_limit	disk_size	target_dir			bind_dir
dir	lzo-rle		150M		1000M		/var/lib/openhab2/persistence	/persistence.bind

# log	alg		mem_limit	disk_size	target_dir		bind_dir		oldlog_dir
log	lzo-rle		250M		500M		/var/log		/log.bind

openhabian@openHAB:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 29G 6.7G 22G 25% /
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 179M 1.8G 10% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda3 30G 45M 28G 1% /storage
/dev/mmcblk0p1 253M 45K 253M 1% /boot
/dev/zram1 227M 222M 0 100% /opt/zram/zram1
overlay1 227M 222M 0 100% /var/log
tmpfs 388M 0 388M 0% /run/user/1000

events.log & openhab.log just stop mid line and will not continue to be filled.
It seems like the 250mb memory limit is used as a maximum size for zram device and not the 500mb that it should if I understood the config correctly.
Also shouldn’t old logs not gotten rotated out of that folder? I have a few log.1 log.2 and log.gz files there that fill up the device.

Read more carefully.
You still fail to give the basicmost information. OS, OH versions ? openHABian branch ?

Right. That should not happen. Have you restarted ZRAM or rebooted ? Reinstalled ?

no
OH handles that

There was a bug in the creation of zram devices that was causing the mem limit to be used as both the max disk size and mem limit for all devices. If you reinstall it should be fixed and resolve your issue.