appreciated/apexcharts-flow

Memory Leak in Apex Chart when frequently using Vaadin push

frankrues opened this issue · 0 comments

Description
We have a dashboard in our Web Application showing different kind of data using ApexChart. The user can use an "Auto Refresh" function, where the server uses Vaadin's UI push mechanism to update the web view (based on a user defined interval).
When I look at Chrome Dev Tools -> Memory Total JS Heap Size, I can see that it is increasing from 15.3 MB to 28.1 MB in 2 minutes (push interval every 2 seconds). The memory is constantly increasing until Chrome reports an out of memory on the page.
I'm using Bar and Pie charts. The memory consumption is not related to any data. Even when the data isn't changing in-between the push intervals, more and more memory is consumed.

Note: if I don't use any ApexChart in the dashboard, the memory is not increasing

I also checked, it does not make any difference if

  1. each time to create a new chart, or
  2. each time update the series from an existing chart

Steps or code example to Reproduce

  1. Create a newScheduledThreadPool(1) and scheduleAtFixedRate with 2 seconds
  2. in the thread's runnable method, create a new chart or update the chart's series and use UI's push method
  3. Observe the memory consumption

image

**Desktop **

  • Windows 10
  • Chrome 104.0.5112.81 (Official Build) (64-bit)
  • 2.0.0-beta13
  • Vaadin 14.7.5
  • Vaadin Production Mode
  • Spring Boot v2.5.5