High Mem Utilisation of rendering process when autosize is enabled
Hello Team!
I was working on one client application in which we have 4 trend plots with 4 traces in each line plot. These are the live charts that keep on accumulating the data from a particular start time. Surely, Plotly is a superb library for plotting with a wide coverage of charts but I am facing one issue with plotly. For a long time, I was wondering how our app is using high amount of memory. With some hard debug, I realized that it is the auto-sizing feature of plotly which is causing this high memory utilization. Because of this high resource utilization, we also see the 'Webgl is not supported' error frequently.
With autosize feature enabled in plotly layout configuration, the rendering process mem utilization is 784.4 MiBs just after start of plotting

With autosize feature disabled, the rendering process mem utilization is just 94.8 MiBs just after start of plotting

Here are some more details:
Plolty.js version: 2.9.0
Angular-plotly.js: 4.0.4
No. of Trend plots on page : 4
No. of traces in each plots : 4
Data update frequency: 1 Hertz
Layout : {
config : {
responsive: true,
},
layout: {
bargap: 0.90,
showlegend: true,
autosize: true,
annotations: [],
legend: {
xanchor: 'center',
yanchor: 'top',
x: 0.47,
y: this.constants.LEGEND_YAXIS_NORMAL,
orientation: 'h',
font: {
size: 12,
},
},
width: '',
height: this.constants.TREND_PLOT_HEIGHT,
margin: {
l: 40,
r: 30,
t: 38,
b: 40,
pad: 0,
autoexpand: true,
},
title: {
x: 0,
text: '',
font: {
family: 'Exo 2',
style: 'normal',
weight: 'bold',
size: '13',
color: 'rgba(0, 31, 66, 0.96)',
},
xanchor: 'left',
pad: {
l: 15,
}
},
hovermode: 'x',
xaxis: {
type: 'date',
title: {
text: 'TIMELINE',
standoff: 5,
font: {
size: 14,
color: 'Arial Black',
family: '"Open Sans", verdana, arial, sans-serif',
},
},
color: 'rgba(0, 29, 61, 0.71)',
range: [],
constrain: 'domain',
tick0: 0,
nticks: 8,
autorange: true,
automargin: true,
rangemode: 'nonnegative',
zeroline: true,
showgrid: true,
showline: true,
domain: [0 , 1],
rangeslider: {
visible: true,
bgcolor: 'rgba(188, 198, 204, 0.5)',
thickness: this.constants.NORMAL_SLIDER_HEIGHT,
range: [],
yaxis: {
rangemode: 'fixed',
range: [-100, -50]
},
yaxis2: {
rangemode: 'fixed',
range: [-100, -50]
},
yaxis3: {
rangemode: 'fixed',
range: [-100, -50]
},
yaxis4: {
rangemode: 'fixed',
range: [-100, -50]
},
},
},
shapes: []
}
};
Let me know if I need to change anything in the layout configuration to lower down the mem utilization while keeping the autosize feature. Otherwise, We will have to think about implementing the auto-sizing mechanism without auto-size.
Thanks!!
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson