tavicu / homebridge-samsung-tizen

Homebridge plugin for Samsung TV's with Tizen OS
MIT License
638 stars 86 forks source link

out of memory error #673

Closed gtalusan closed 3 months ago

gtalusan commented 3 months ago

I have a Samsung QN55Q90TAF. I use this plugin to expose the ON/OFF status to HomeKit, so my configuration is minimal. Just the IP address and MAC address of the TV are set.

This plugin is set to run on its own child bridge. Every few days, I'll see this message in the log file:


<--- Last few GCs --->

[289146:0x6349870] 133506148 ms: Mark-sweep 2046.6 (2084.1) -> 2045.7 (2084.1) MB, 4843.2 / 0.0 ms  (average mu = 0.459, current mu = 0.427) allocation failure; scavenge might not succeed
[289146:0x6349870] 133514174 ms: Mark-sweep 2046.7 (2084.1) -> 2045.7 (2084.3) MB, 5013.7 / 0.0 ms  (average mu = 0.417, current mu = 0.375) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb95b60 node::Abort() [homebridge: homebridge-samsung-tizen]
 2: 0xa9a7f8  [homebridge: homebridge-samsung-tizen]
 3: 0xd6f2f0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [homebridge: homebridge-samsung-tizen]
 4: 0xd6f697 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [homebridge: homebridge-samsung-tizen]
 5: 0xf4cba5  [homebridge: homebridge-samsung-tizen]
 6: 0xf5f08d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [homebridge: homebridge-samsung-tizen]
 7: 0xf3978e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [homebridge: homebridge-samsung-tizen]
 8: 0xf3ab57 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [homebridge: homebridge-samsung-tizen]
 9: 0xf1bd2a v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [homebridge: homebridge-samsung-tizen]
10: 0x12e114f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [homebridge: homebridge-samsung-tizen]
11: 0x170deb9  [homebridge: homebridge-samsung-tizen]
[3/19/2024, 2:46:04 AM] [homebridge-samsung-tizen] Child bridge process ended
[3/19/2024, 2:46:04 AM] [homebridge-samsung-tizen] Process Ended. Code: null, Signal: SIGABRT
[3/19/2024, 2:46:11 AM] [homebridge-samsung-tizen] Restarting Process...
tavicu commented 3 months ago

Don't run it as child bridge since the plugin already create a bridge for every TV.

Also you may have a problem if you used many inputs. But since you didn't post your config I cannot help you with this one. https://tavicu.github.io/homebridge-samsung-tizen/troubleshooting/open-new-issue.html

gtalusan commented 3 months ago

Here's the config. Does it help?

{
    "devices": [
        {
            "name": "Main TV",
            "ip": "10.0.1.71",
            "mac": "F4:FE:FB:54:36:B6",
            "inputs": []
        }
    ],
    "_bridge": {
        "username": "0E:E2:E0:9E:6C:1B",
        "port": 45071
    },
    "platform": "SamsungTizen"
}
tavicu commented 3 months ago

Cool. So it's not from inputs. If you use many applications the plugin make a request for each input. That's why I asked.

ust remove the child bridge for the plugin. You don't need that.

gtalusan commented 3 months ago

Ok here's the config now.

{
    "devices": [
        {
            "name": "Main TV",
            "ip": "10.0.1.71",
            "mac": "F4:FE:FB:54:36:B6",
            "inputs": []
        }
    ],
    "platform": "SamsungTizen"
}

The reason I placed this into the child bridge is because I believe this crash has brought down my homebridge and smart home integrations previously.

What are next steps here?