Closed Kev1000000 closed 2 years ago
I believe I am experiencing the same issue. Have just had to restart due to apparently running out of memory. I do not use the integration though. I will confirm if this happens again and check memory stats too.
Having the same issue, Unifi crashes on daily base.
Same issue here. I have set up an automation to restart the Unifi add-on when my memory hits 80% and then it drops back to 40% and is ok for 12-18 hours before it happens again.
same here, started happening when i moved HA from an RPI to an Intel NUC (although it may just as well be from a Unifi plugin update..)
crashes happen anywhere between 1 - 3 days, but usually within 1 day.
Ubuntu 20.04.3 LTS Docker v20.10.11 HA Supervisor v2021.10.8 HA Core v2021.11.5 Unifi Plugin v1.1.1
(i should note that it had this same issue with many HA Core / Supervisor and Unify Plugin versions in the past too, updated many times and no changes)
my settings:
my logs:
[11:00:03] INFO: Now starting the UniFi Network Application...
[11:00:03] INFO: Note: No add-on specific logs beyond this point.
Exception in thread "https-jsse-nio-8443-Acceptor-0" Exception in thread "cron4j::scheduler[a3233a0243c201425cb321400000017d8ef8d00c4cc87f74]::timer[a3233a0243c201425cb321400000017d8ef8d00d0e471891]" Exception in thread "shutdown-listener" java.lang.OutOfMemoryError: Java heap space
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb" Exception in thread "webapi-90" Exception in thread "webapi-86" Exception in thread "webapi-88" java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
at org.apache.tomcat.util.net.SecureNioChannel.<init>(SecureNioChannel.java:80)
at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:415)
at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:508)
at java.lang.Thread.run(Thread.java:748)
java.lang.OutOfMemoryError: Java heap space
Exception in thread "inform-238" Exception in thread "inform-239" java.lang.OutOfMemoryError: Java heap space
Exception in thread "inform-224" Exception in thread "inform-205" Exception in thread "inform-236" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "inform-237"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "inform-234"
Exception in thread "inform-234" Exception in thread "cron4j::scheduler[a3233a0243c201425cb321400000017d8ef8d00f715041de]::launcher[a3233a0243c201420bbc20840000017d96a074452d97cde2]" java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-73" Exception in thread "inform-232" java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-97" java.lang.OutOfMemoryError: Java heap space
Exception in thread "WsSitesList" java.lang.OutOfMemoryError: Java heap space
Exception in thread "inform-229" java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-nio-8080-Acceptor-0" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "Timer-0" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "discover" Exception in thread "inform-242" java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-91" java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-93" Exception in thread "inform-231" Exception in thread "inform-215" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Tomcat]]" Exception in thread "pool-5-thread-1" Exception in thread "inform-241" Exception in thread "inform-222" Exception in thread "https-jsse-nio-8443-ClientPoller-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-3-thread-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-89" Exception in thread "webapi-92" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "stat-processor" java.lang.OutOfMemoryError: Java heap space
Exception in thread "https-jsse-nio-8443-AsyncTimeout" java.lang.OutOfMemoryError: Java heap space
Exception in thread "https-jsse-nio-8443-ClientPoller-0" Exception in thread "https-jsse-nio-8843-ClientPoller-0" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "inform-235" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-2-thread-4" java.lang.OutOfMemoryError: Java heap space
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb" java.lang.OutOfMemoryError: Java heap space
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb" java.lang.OutOfMemoryError: Java heap space
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb" java.lang.OutOfMemoryError: Java heap space
Exception in thread "StunServerListener" Exception in thread "http-nio-8880-ClientPoller-1"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-nio-8880-ClientPoller-0"
java.lang.OutOfMemoryError: Java heap space
Exception in thread "https-jsse-nio-8843-ClientPoller-1" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "cron4j::scheduler[a3233a0243c201425cb321400000017d8ef8d00f715041de]::timer[a3233a0243c201425cb321400000017d8ef8d00f377da2c2]"
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb" java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-5-thread-2" Exception in thread "http-nio-8080-ClientPoller-1" Exception in thread "pool-3-thread-2" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-4-thread-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-3-thread-3" Exception in thread "pool-4-thread-2" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-nio-8080-ClientPoller-0" java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-3-thread-4" java.lang.OutOfMemoryError: Java heap space
I have the same problem. Happens every other day.
Exception in thread "stat-processor" java.lang.OutOfMemoryError: Java heap space
at java.lang.StringCoding.decode(StringCoding.java:215)
at java.lang.String.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
this should not be marked as stale
, the issue persists
Having the same issue here.... integrations dont get info from the controller cause controller crashed...trying to reach controller...get a white blank page...have to restart the Addon...even watchdog dont help..
i even have a (scary) visual representation of this memory leak.. this is on a NUC10I5FNH2 with a Intel Core i5-10210U Processor (6M Cache, up to 4.20 GHz), and this integration eats it all up very fast
And this is what happens when I force stop the Unifi integration (before it just dies itself)
I bought a Home Assistant Blue, migrated my whole HA setup to it, this integration (latest version) on an official supported device, nothing else installed except HA, and it still has the memory leak and crashes constantly.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...
-----------------------------------------------------------
Add-on: UniFi Network Application
Manage your UniFi network using a web browser
-----------------------------------------------------------
Add-on version: 1.1.4
You are running the latest version of this add-on.
System: Home Assistant OS 7.4 (aarch64 / odroid-n2)
Home Assistant Core: 2022.2.7
Home Assistant Supervisor: 2022.01.1
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] unifi.sh: executing...
[cont-init.d] unifi.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[01:29:35] INFO: Now starting the UniFi Network Application...
[01:29:35] INFO: Note: No add-on specific logs beyond this point.
Exception in thread "http-nio-8080-Acceptor-0" java.lang.OutOfMemoryError: Java heap space
Exception in thread "inform-85"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "inform-85"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "https-jsse-nio-8443-AsyncTimeout"
Exception in thread "cron4j::scheduler[10f97846003909780561c0310000017f04defef328954826]::timer[10f97846003909780561c0310000017f04defef3562d6a8a]" Exception in thread "webapi-9" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Timer-0" Exception in thread "http-nio-8880-ClientPoller-1" java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects
Exception in thread "inform-79" Exception in thread "inform-84"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "https-jsse-nio-8443-Acceptor-0"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-nio-8880-ClientPoller-1"
Exception in thread "https-jsse-nio-8843-ClientPoller-1" Exception in thread "pool-5-thread-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "cluster-ClusterId{value='620d88f2e9d29101478226e6', description='null'}-localhost:27117" Exception in thread "cron4j::scheduler[10f97846003909780561c0310000017f04defee506ae419a]::timer[10f97846003909780561c0310000017f04defee85cb0fc54]" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-10" Exception in thread "inform-83" Exception in thread "webapi-11"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "webapi-11"
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Tomcat]]" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "webapi-7" java.lang.OutOfMemoryError: Java heap space
Exception in thread "WsSitesList" java.lang.NullPointerException
at com.ubnt.service.sdn.V$_o.run(Unknown Source)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb:651174838" java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-nio-8880-ClientPoller-0" Exception in thread "https-jsse-nio-8443-ClientPoller-0" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "shutdown-listener" java.lang.OutOfMemoryError: Java heap space
Exception in thread "stat-processor" java.lang.OutOfMemoryError: Java heap space
Exception in thread "discover" java.lang.OutOfMemoryError: Java heap space
Exception in thread "MQTT Con: 8e122033-8f0e-4711-8197-8b23e21aa8fb:651174838" java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-nio-8080-ClientPoller-0" java.lang.OutOfMemoryError: Java heap space
Exception in thread "pool-2-thread-3" java.lang.OutOfMemoryError: Java heap space
Just an update kinda solve it
I just put the Memory alocation for the container to 2Gb anto all was resolved. Unifi controller is memory hungry.. when I saw the logs it was asking for more tuan 1Gb as you installed it by default in the addons
just change the memroy to whatever tou want and it will not crash
@signaleye
kinda solve it
are you sure? can you confirm it's still solved?
I just put the Memory alocation for the container to 2Gb anto all was resolved. Unifi controller is memory hungry.. when I saw the logs it was asking for more tuan 1Gb as you installed it by default in the addons
so you increased the RAM memory cap for the docker container to 2gb instead of 1gb from the terminal? I'd need to try to root the HA Blue device to do that, as it doesn't allow me to make changes to docker containers of official integrations (they don't even show up in portainer)
I think he means in the Configuration section in the add-on, it has a place to set minimum and maximum memory.
@TheEffbee @signaleye
If that's what he meant, then it does not fix this issue, as I did state in a previous comment:
my settings:
Initial Memory: 256 Max Memory: 1024 (also tried with 2048, but it still crashes)
So far on my Raspberry Pi4 4GB it has been running for two days with no crashes, after changing:
Initial Mem: 1024 Max Mem: 2048
Add-on RAM Usage has been between 23-26%
@TheEffbee i think it will still crash for u too later on
I tried with init memory 512 and max memory 2048 on the Home Assistant Blue device after my last comment and it died in less than 10h, I also tried these settings on a powerful intel nuc and it had no effect there either, max time the addon didn't crash for me was about 7 days (i think)
@jaruba It's been around two weeks and no crashes yet. Mem Usage at 30.8%
@TheEffbee thanks for reporting back, 2 days after ur message i did an update to both the OS and HA, it didn't go down since then for me either, i'm scared to jinx it though.. but it did go down after trying to increase the mem limit (numerous times) so my hopes are that the updates helped, maybe the mem leak was in the java version used 😕
I'll ping back if it dies out again
I can confirm that this has been running fine for me too for a long time now, it seems that the OS and HA update fixed it for me
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Problem/Motivation
Expected behavior
Actual behavior
Steps to reproduce
Note, I do use the Unifi integration to track devices and use those within HA to track person status. Not sure if that is related. I have about 70 clients within my Unifi instance, but I only am tracking devices on 2 SSIDs, totalling around 20 devices.