Current filter:
                                You should refresh the page.
                                  • Hello,

                                    I have recently upgraded my app from DevEx 16 to DevEx 19.1.6, and have moved the reports preview tool from the ASPxReportViewer to the ASPxWebDocumentViewer during this conversion. Through testing and other questions in the KB, the new WebDocumentViewer has been working in this environment and the upgrade has been published to the production site, approximately 8 days ago.

                                    Just for background, none of the reports in our web app allow for user design, nor do they allow for users to change parameters. When called by the user, each report is created and displayed as preview in the (new-to-us) ASPxWebDocumentViewer.

                                    This has been working well, but with today being the first full workday after a holiday week, we began receiving calls from users who were experiencing an "out of memory" message in the preview area of the ASPxWebDocumentViewer.

                                    In researching this through your KB, I came across this ticket: https://www.devexpress.com/Support/Center/Question/Details/T407747/aspxwebdocumentviewer-memory-usage and began to understand that these reports are handled differently in memory than the ASPxReportViewer we were using before.

                                    From that ticket, I have made the suggested change to the Application_Start in Global.asax:

                                    [C#]
                                    DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.UseFileDocumentStorage(Server.MapPath("~/App_Data/PreviewCache"));

                                    This seems to be a good solution, but I'm not sure that our work is done, as the "App_Data/PreviewCache/" folder is filling up.

                                    QUESTIONS:

                                    1. How does the "App_Data/PreviewCache/" folder get cleaned up ... how do older document creations get deleted to free up memory?

                                    2. I would like to minimize the amount of time a report is saved in the cache folder ... no more than 10 or 15 minutes. The ticket referenced above also included this code, but I wasn't sure if it applied in this situation, and if it does -- where should this code be placed? (I have not used this code yet)

                                    [C#]
                                    DefaultWebDocumentViewerContainer.Register<StoragesCleanerSettings, CustomStoragesCleanerSettings>(); public class CustomStoragesCleanerSettings : StoragesCleanerSettings { static StoragesCleanerSettings DefaultSettings = StoragesCleanerSettings.CreateDefault(); public CustomStoragesCleanerSettings() : base(DefaultSettings.DueTime, DefaultSettings.Period, TimeSpan.FromMinutes(20)) { } }

                                    Looking forward to all information to get this working efficiently as soon as possible, with 500+ users generating multiple short (1-3 pages) per day ...

                                    Thank you!
                                    Julie Schwalm
                                    iForgeAhead.com

                                • Julie Schwalm 12.02.2019

                                  IMPORTANT UPDATE:

                                  The above post was written right after the change mentioned, that the report previews are stored on the server file system based on the single line (above) added to Global.asax.

                                  This worked for a couple of hours, until I started getting calls from clients saying they could not preview any report. I tried it from here (also on the LIVE system), and got the same results they were reporting.

                                  THE RESULTS when trying to preview a report (any report) at this point:
                                  -  the toolbar of ASPxWebDocumentViewer appears, along with a gray area beneath the toolbar where the report should preview
                                  -  there is no 'red band' error message in the preview area (for the OP, there was a red band saying "out of memory", but nothing there now)
                                  -  the paginator of the toolbar displays the correct amount of pages for the requested report
                                  -  clicking the NEXT button in the paginator refreshes the page and the viewer, updating to show viewing Page 2, but still no page displayed in preview
                                  -  no error message where the preview should appear
                                  -  no error message in my error logging program
                                  -  no DevEX CALLBACK error - I've had this logging system in place for a while, and nothing is appearing here * PLEASE NOTE THIS! *

                                  Due to this issue, I have commented out the line referenced above in Global.asax:

                                  [C#]
                                  'DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.UseFileDocumentStorage(Server.MapPath("~/App_Data/PreviewCache"))

                                  This adjustment is allowing my users to create reports ... FOR NOW! With enough users doing this at the same time, we will be back at the problem that originated this ticket (please review above).

                                  This is a live environment and I'm cobbling it together for a couple of hours for the users to proceed ... PLEASE HELP!

                                  Thanks in advance,
                                  Julie

                                • Yaroslav (DevExpress Support) 12.03.2019

                                  Hi Julie,
                                  >>and began to understand that these reports are handled differently in memory than the ASPxReportViewer we were using before
                                  Indeed, those two viewers have a different memory model. In the case of the new viewer, we don't want to recreate the document each time the user refreshes the page (because this is a CPU-intensive task, especially for large reports). So, we keep a copy in memory. If you enable the file-based storage, we create a second copy of this document that is stored on your hard drive. So, there are two document copies, each with its own expiration timeout associated. StoragesCleanerSettings and CacheCleanerSettings are the two classes that control these timeouts. If you need to dispose of an in-memory copy as fast as possible, you need to use CacheCleanerSettings and not StoragesCleanerSettings.

                                  >>where should this code be placed?
                                  You can really place this code anywhere in your application. The only requirement here is to register your custom service implementation at the application start-up using DefaultWebDocumentViewerContainer.Register.

                                  Regarding your follow-up question, I'm not sure whether the behavior you observe is related to memory shortage: as you mentioned, there is no red banner indicating a server error. Please perform the following troubleshooting steps:

                                  1. Implement and register the the LoggerService class in your application (most likely, you already have one implemented). Reproduce the issue. Collect the information abound unhandled exceptions that occur on the server (if any) using this service.
                                  2. Open the browser's developer tools (F12) and switch to the "Network" tab. Reproduce the issue. Then, right click the Network tab and save the profiling results into HTTP Archive format (*.har) file.
                                  3. Open the browser's developer tools (F12) and switch to the "Console" tab. Reproduce the issue. If there are any client-side errors, please let us know what they are.

                                  Regards,
                                  Yaroslav

                                • Julie Schwalm 12.03.2019

                                  Hi Yaroslav,

                                  Thanks very much for the information.

                                  It appears from your comments that using the file-based storage system doesn't replace the 'in memory' storage that is used by default, it just creates another copy as a file, but the 'in memory' copy is still there as well. Is that correct? I am currently NOT using the file-based system that I tried briefly last night.

                                  I would appreciate some additional instructions to clean up memory within 5 minutes of report creation. I understand from your comments that I should place the following code in its own class file:

                                  [C#]
                                  DefaultWebDocumentViewerContainer.Register<StoragesCleanerSettings, CustomStoragesCleanerSettings>(); public class CustomStoragesCleanerSettings : StoragesCleanerSettings { static StoragesCleanerSettings DefaultSettings = StoragesCleanerSettings.CreateDefault(); public CustomStoragesCleanerSettings() : base(DefaultSettings.DueTime, DefaultSettings.Period, TimeSpan.FromMinutes(20)) { } }

                                  And that I should register this in Application_Startup of Global.asax. Please provide the statement to register it.

                                  You also mentioned "If you need to dispose of an in-memory copy as fast as possible, you need to use CacheCleanerSettings and not StoragesCleanerSettings."

                                  Does this mean I shouldn't use the above class? Or use another one in addition? Again, please provide an outline of code if needed.

                                  Finally, I re-read the previous ticket that I linked to in the OP. It had another section that I've copied below. Is this something else I should / could use?

                                  >>Is there a method  to force the cache to clear  for a report ?
                                  Yes, there is such a method:

                                  [JavaScript]
                                  [JavaScript]

                                  If so, what event does this Javascript belong to?

                                  Thanks in advance,
                                  Julie

                                • Yaroslav (DevExpress Support) 12.04.2019

                                  Julie,

                                  >>but the 'in memory' copy is still there as well. Is that correct?
                                  This is correct. Even though your document is in the file-based cache, we need to load it (or its part) to process a user request (such as a request to render a new document page).

                                  >>I would appreciate some additional instructions to clean up memory within 5 minutes of report creation. Please provide the statement to register it.
                                  Sure, here is code snippet you need to put in the Global_asax.Application_Start method:

                                  [C#]
                                  StoragesCleanerSettings DefaultSettings = StoragesCleanerSettings.CreateDefault(); DefaultWebDocumentViewerContainer.RegisterSingleton(new CacheCleanerSettings( DefaultSettings.DueTime, //For internal use DefaultSettings.Period, //For internal use TimeSpan.FromMinutes(5), //Indicates the lifetime of a report in a storage. TimeSpan.FromMinutes(5) //Indicates the lifetime of a report's document in a storage. )); ASPxReportDesigner.StaticInitialize();

                                  >>Does this mean I shouldn't use the above class?
                                  No, I didn't mean that. My only point is that this class (StoragesCleanerSettings) controls the file-based storage, and therefore any settings at its level cannot reduce the memory pressure put on your web server (which is the exact issue you're trying address).

                                  >>It had another section that I've copied below. Is this something else I should / could use?
                                  I don't see any code, but I believe you're referring to this solution: Web Document Viewer - How to dispose of a report object after the report generation. It is recommended practice to notify the server that the resources it keeps are no longer necessary. I suggest that you use this approach in your application.

                                  I hope this clarifies the situation. Should there be further questions, let us know.

                                  Regards,
                                  Yaroslav

                                0 Solutions

                                Creation Date Importance Sort by