CPU utilization and memory leak from UWP SfPdfViewer even after closed it

Hi,

We are showing SfPdfViewer control (v17.4.0.51) in a dialog and bind a Stream into ItemsSource property to view the PDF. Once viewed, we've closed the entire dialog. But still few Timers running in SfPdfViewer even after closing the entire dialog and keep on utilizing some amount of CPU & Memory even our entire application is idle.

Seems Dispose method not available in SfPdfViewer control. Is there any way to dispose the control properly and resolve CPU utilization & Memory?

Below screenshots taken from dotTrace tool after closing the dialog and these many calls have been made within 3 mins duration. 





5 Replies 1 reply marked as answer

AV Ashokkumar Viswanathan Syncfusion Team November 5, 2020 02:03 PM UTC

Hi Selvamz, 
 
Greetings from Syncfusion support, 
 
We are able to reproduce the issue, “Memory issue even after leaving the PdfViewer control“. Currently, we are validating the issue and we will update further details on November 9th  ,2020. 
 
Regards, 
Ashok Kumar Viswanathan. 



AV Ashokkumar Viswanathan Syncfusion Team November 9, 2020 03:33 PM UTC

Hi Selvamz,  
  
Sorry for the inconvenience caused, 
  
We are still validating the issue, “Memory issue even after leaving the PdfViewer control” due to its complexity. We will update the further details on November 11th, 2020 without any further delay.  
  
Regards,  
Ashok Kumar Viswanathan. 



AV Ashokkumar Viswanathan Syncfusion Team November 12, 2020 06:06 PM UTC

Hi Selvamz, 
 
The issue, “Memory issue even after leaving the PdfViewer control” is resolved in our latest version of SfPdfViewer control v18.3.0.47. However we need to use Unload(true) API on leaving the page containing the PDFViewer control. Kindly update to the latest version of SfPdfViewer control to resolve the issue. 
 
Please find the modified sample to resolve the issue, 
 
Please find the demo video illustrating how we used DotTrace to get the memory consumption, 
 
Regards, 
Ashok Kumar Viswanathan. 


Marked as answer

ID Ian Davidson November 30, 2020 04:09 PM UTC

Hi, 

I'm still seeing memory leaks in this control. 

When I load a PDF it climbs from 100mb to maybe 300mb, then drops down to 200mb or so when I leave. If I go load it again, it climbs to 500Mb+ then reduces maybe half, and keeps climbing like that.

I'm using the 18.3.0.51 version of the control and unloading, as you've mentioned below, but can't seem to keep the memory from increasing when going in and out of that screen, loading a PDF. 

I have tried disposing of everything in the page, i've unloaded and removed handlers, but nothing seems to make much difference.

I found that using pdfViewer.Dispose() actually increased the memory! So avoided that. 


AV Ashokkumar Viswanathan Syncfusion Team December 1, 2020 08:36 AM UTC

Hi Selvamz, 
 
We were unable to reproduce the issue, “Application memory increase while loading and unloading multiple times” in our last update. The memory range is maintained at 200MB. We suspect that, this issue may be specific to the PDF document. 
 
Please find the sample, which we have tried in our end, 
 
kindly share the following details to analyze more on this issue and assist you with the better solution       
  1. Simple sample/ Modify the above sample to reproduce the issue.
  2. PDF document
  3. Replication video/procedure to reproduce the issue.
 
Regards, 
Ashok Kumar Viswanathan. 


Loader.
Up arrow icon