Menu
Download Free Trial

Memory leak

I am creating the flex pivot as below:
 

$scope.mainPivot = $(pivotGridSelector).flexmonster({
global: {
localization: $scope.flexPivot.LocaleData //localeJsonpath
},
customizeCell: customizeCellFunction,
licenseKey: response.licenseKey,
beforetoolbarcreated: customizeToolbar,
componentFolder: "libs/flexmonster/",
toolbar: true,
height: "100%",
width: "100%",
report: flexReport
});

 
and on angular scope destroy, I have following code:
 

$scope.$on("$destroy", function() {

    $scope.mainPivot.dispose();
});

 
But I still see detached dom tree and they are pointing to flex nodes. What am I missing?
My application is leaking around 30MB everytime, when I open the page with flex and close it every time.
Please suggest.

10 answers

Public
Dmytro Zvazhii Flexmonster July 3, 2017

Hello Sohan,
Thank you for your question. Could you please provide us with the sample project so we can make some tests and reproduce the issue on our side? It will help us a lot in our further investigation.
Best regards,
Dmytro.

Public
Sohan July 4, 2017

Here is the fiddle for the same. I have not included angular code here,just flex pivot.
https://jsfiddle.net/sohansoni/qae2sxzk/3/
Observe the memory usage when this page is launched. Then do the create and dispose several times.
Observe the memory usage, It has gone up. Now in chrome dev tools take a heap snapshot.
I see lot of Detached DOM Tree related to flex

Public
Dmytro Zvazhii Flexmonster July 4, 2017

Hello Sohan,
Thank you for providing us with the example. We need to take some time on the investigation. The fix will be presented in the 2.4 major update which is going to be released in a month.
Best regards,
Dmytro.

Public
Sohan July 6, 2017

Thanks Dmytro, But were you able to reproduce it ?

Public
Dmytro Zvazhii Flexmonster July 6, 2017

Hello Sohan,
Yes, we have reproduced the issue.
Best regards,
Dmytro.

Public
Sohan July 6, 2017

Thank you for the confirmation !

Public
Sohan September 13, 2017

Hello,
I see new major upgrade 2.403 released on 11th Sep 17, does it include memory leak fix ?
 

Public
Ian Sadovy Flexmonster September 13, 2017

Hello Sohan,
 
Yes, we have optimized memory usage in the version 2.4. 
So you are welcome to download the latest 2.403 release and try it. 
 
Please let us know if it helps to resolve the memory leak.
 
Regards,
Ian

Public
Sohan September 25, 2017

I am afraid to say this but this is still not resolved. Can you please look into it ?
While analyzing on chrome dev tools if I disable customizeCell and toolbar, then memory leak is reduced.
However with no toolbar and no custom customizeCell function, memory is still getting leaked, and I still see customizecell function taking lot of memory, even updateLabels function.

Public
Ian Sadovy Flexmonster October 4, 2017

Hi Sohan!
Could you please send us a sample with the memory leak issue? We’ve made some tests but they show only small leaks but I think in your case, it should be several megabytes per update. 
Thanks

Please login or Register to Submit Answer