ArcGIS js API 4.x : Is there memory leak when adding and removing graphics in the view

1160
5
07-09-2019 01:43 AM
CharlesMILLOT1
New Contributor II

Hi,


here is a little sample with a button which remove graphics and add 5000 new random graphics to the default graphiclayer .


we can see that the memory increase after each click and is never released even if we force garbage collection in the browser.

May be there is a mistake in my sample?

Is there a memory leak in the API?

Is there a workaround to adda and remove graphics periodically without memomry leak?

Browser used : Firefox (60.7.2ESR)
ArcGIS API for JavaScript : 4.11


Thanks in advance

Tags (2)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Charles,

   Try 4.12. I see that GC occurs after a couple of seconds automatically.

0 Kudos
CharlesMILLOT1
New Contributor II

Robert,

thank for your response.

I tried with 4.12 and have the same result.

I launch the page.

Firefox take about 500Mb of memory.

After 50 creation/removing of the 5000 graphics the memory has grown up to 1Gb!

any other idea?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Charles,

  I sorry I forgot the part about you using Firefox. I tested in Chrome and did not have that issue.

0 Kudos
CharlesMILLOT1
New Contributor II

Robert,

I tested with Chrome 75 and reproduce that issue.

GC occurs but not all the memory is released.

After several add/remove of graphics, the memory increase ever and ever despite of the GC.

Thanks for your help.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Charles,

  Then you need to contact esri tech support and open a bug for this.

0 Kudos