RadChart memory storage

Thread is closed for posting
2 posts, 0 answers
    SERGIO avatar
    1 posts
    Member since:
    Feb 2013

    Posted 17 Apr 2013 Link to this post

    My scenario is that I need to refresh a RadChart's data on my page periodically with a timer (around one minute) and the radchart is created dianmically from code behind.
    I have tried two different solutions but each of them has some memory/space issue:
    1. Setting the Usession property of the radchart to true, the memory grows exponentially at every postback (each time the radchart refreshes); then, after short time (depending on how many users, number of radcharts on my page and refreshing time of each radchart)  the iis instance's memory explodes and blockes everything. I understand that every time a chart refresh,  its image is memorised in session, so that is the casue why memory grows. Is there any solution to that? use the same variable in session in order to stop memory from growing? is there any setting apropiate for that?

    2. The other solution i tried: setting usession property to false, and use the temporary virtual path to store the images. This way is much better, and the application (iis process) does not have any memory problem, but i have to manage the space on the disk.  Any suggestions here? is there a way to override files (not creating a new one each time with a different name)?  or is there any other possible solution apart separately managing the cleaning of this directory?

    Could you please indicate me wich of the 2 solutions is more suitable and answer the relative questions.
    Any help qould be appreciated.
    Thanks a lot in advance.

  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 18 Apr 2013 Link to this post

    Hi Sergio,

    There is one possible scenario, which would lead to such behavior. It involves AJAX updates, where other parts of the page are updated, but not the chart. Is this the case?

    Here are some details about how RadChart works: the RadChart server control renders an image and places it in the session or saves it on the disk. Later, when the browser requests the image, the ChartHttpHandler retrieves the image and deletes it from the session/disk. Now, when AJAX request is performed, a new image is generated as the page lifecycle is preserved, but that image is never requested by the browser, so it stays in the session. 

    1. The first solution is to re-work the ajax settings, so that RadChart is always updated on AJAX request. You can try adding all the RadCharts in the page as updated controls in every item in RadAjaxManager.AjaxSettings collection. For more information, please read this help topic.

    2. As I said earlier, the ChartHttpHandler automatically deletes the unnecessary images, so you shouldn't need to manage this yourself. If the image files remain after all, this means that there is something that is preventing the RadChart from deleting them. If this is the case, please check if the files are getting locked. 

    I hope this helps.
    All the best,
    Petar Kirov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top