I have a question related to report object disposition.
I am using WebdocumentViewer to genertae reports, i noticed that when we create some large reports, server memory increases. But that memory is not getting released after closing that report page.
I want to know, is there any best place we can dispose report manually, so that we can release memory after load complete.
I know, that the report object is kept on cache or somewhere, so that the export and other functions may work.
Please suggest me the best way, so that i can manage server memory while using reports.
Thank you for contacting us. Simply put, each time a page in the Web Document Viewer is loaded in the browser, the report creation process starts in a background thread. Once a document is ready, it is getting placed into in-memory storage to make the report document available for further requests sent by the viewer (for example, for printing/exporting). This cache is stored on the web server for 2 hours. So, after you refresh your web page, the viewer creates a new instance of the document and puts it into the cache. The previous document is not cleared from the cache because the viewer cannot determine that the previous session already ended.
To reduce memory usage in this situation, I suggest that you call the client-side ASPxClientWebDocumentViewer.Close method when a web page is being closed (e.g., in the window's onbeforeunload event handler). For instance:
As a result, the closed document's data will be cleared from the web server.
Additionally, I would like to note that starting with version 18.1, we provide the CachedReportSource component designed to improve the performance and memory handling while working with large reports. Check the Reporting - Document Generation Performance Improvements (v18.1) blog post for more information regarding this. You can try using this component in your application to reduce memory consumption.
I look forward to your reply.