RomRider / apexcharts-card

📈 A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant
MIT License
1.16k stars 78 forks source link

High memory usage in Firefox and Tab crash(Previous such issues were closed without resolution) #662

Closed Mrsash2020 closed 2 weeks ago

Mrsash2020 commented 8 months ago

Checklist

Describe the bug I had installed ApexCharts card about six months ago and never had an issue until I updated to latest Firefox. As soon as navigated to the page with the chart, the memory usage goes through the roof crashing that tab. If I access the same page in Edge it doesn’t have this problem.

I removed all but one chart which did not help in Firefox. Then I visited hacs to check if I am missing something. To my amazement ApexCharts card is no longer installed. So I go through and download/install it again which does not fix the issue.

Is anyone else encountered any issues with latest Firefox?

Version of the card Version: 2.0.4

To Reproduce This is the configuration I used:


I downloaded it from hacs but also verified the manual steps confirming js file in local folder etc. 
One interesting issue I faced, tried to add the following in Configuration.yaml resulted in error with check in developer tools

resources:
  - url: /local/apexcharts-card.js?v=2.0.4
    type: module

![image](https://github.com/RomRider/apexcharts-card/assets/62192773/ed850328-c28a-437f-97f4-0fe04b6c2c9f)

screenshot of my resources

![image](https://github.com/RomRider/apexcharts-card/assets/62192773/c78c9930-628e-4292-aebd-b67454b5ba94)

Screenshots If applicable, add screenshots to help explain your problem.

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

cloudbr34k84 commented 8 months ago

Oh man! im getting this on Chrome as well! Anytime i try and load the dashboard that has an APEX chart it crashes. On Mobile Its fine though. ha.cloudbr34k.xyz-1707186351447.log

Mrsash2020 commented 8 months ago

Oh man! im getting this on Chrome as well! Anytime i try and load the dashboard that has an APEX chart it crashes. On Mobile Its fine though. ha.cloudbr34k.xyz-1707186351447.log

So are you experiencing this in Firefox as well?

cloudbr34k84 commented 8 months ago

Oh man! im getting this on Chrome as well! Anytime i try and load the dashboard that has an APEX chart it crashes. On Mobile Its fine though. ha.cloudbr34k.xyz-1707186351447.log

So are you experiencing this in Firefox as well?

Nah in chrome.

neuhausf commented 7 months ago

I noticed this too. Related to HA 2024.2. Similar issue in another card: https://github.com/kalkih/mini-media-player/issues/831

Mrsash2020 commented 7 months ago

Ok I am running the lovelace dash on Firefox and Edge. Its barely responding after a few minutes in Firefox. It is not effecting Edge. The companion app on Android also not effected. For me not sure its mini player

willia0 commented 6 months ago

Hi there, same issue here using both Edge 122.0.2365.80 and Chrome 122.0.6261.112, with high CPU usage and frozen tab. iOS Companion App and Safari works butter smooth.

P.S.: A temporary solution I found is by reducing the graph_span and hence reducing the sample points and then browser seems can handle that. I am now applying limits to sensors update interval to every 30s and observing the outcome.

ackstorm23 commented 5 months ago

Same problem here. Firefox rapidly consumes memory until the tab is killed.

Update: This has become unbearable. I have abandoned apexcharts at this point. None of my other graphing panels encounter this problem, just apexcharts.

LukaszBrzyszkiewicz commented 5 months ago

Same issue - Mobile can't handle viewing Apex charts - it's just crashing. On PC loading Apex charts for 24h time span from single sensor update each 5 seconds took abou 2minutes and CPU usage is sky rocket :) After finishing memory usage for tab is about 32GB RAM ! Same data viewed whole week time span is instant on Grafana. Soemthing is very wrong in ApexCharts and currently is almost unusable. There is no errors in console.

Firefox: 124.0.2. ApexCharts v2.0.4

lymanepp commented 5 months ago

Issue still present in HA 2024.5. Loading a tab that has 3 charts--with 3 days each--rapidly consumes 10GB or more. The page becomes non-responsive and occasionally will crash the tab or Firefox. Setting a 5 minute interval usually allows the tab to load and be stable, at least until it refreshes.

Edit: viewing the tab also makes Android app unstable.

ackstorm23 commented 4 months ago

This guy's fork has been updated and is not causing my memory issues. Just download the .js from his release and over-write it in your existing installation (same as manual instructions for installation) and now it's working fine again.

https://github.com/georgepauna/apexcharts-card

RomRider commented 3 months ago

I've updated the library in the latest dev version, performance has improved quite a lot. You should try it.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] commented 2 weeks ago

This issue was closed because it has been stalled for 10 days with no activity.