Memory allocation w/in Asp.Net

Posted by: sdixon on 3 August 2017, 4:00 pm EST

  • Posted 3 August 2017, 4:00 pm EST

    Is there a way to force the memory allocated to a PivotView/RdDataSource to be cleaned up/released?



    For example, once a user leaves a web page with a PivotView on it, when does the memory used by that PivotView (and its related data source) get released? Is it when their session expires? When the application restarts? Or, is there a manual way that we as developers can clean it up?
  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    Yes, the expiration/termination of a session makes the memory available for garbage collection .

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    Just to be clear, the expiration/termination of a session (independent of the application) makes the memory available for garbage collection (I want to make sure that the entire application doesn't need to be restarted to free up the memory)?
  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    I have discussed with our developmnet team regarding this and as per them when the application stops and the session
    expires, the memory will be set to useless. The memory will be released only when the server recollects memory.

    Best Regards,
    Abhishek


  • Replied 3 August 2017, 4:00 pm EST

    Thanks for the reply.

    Are you looking into other ways to optimize the memory usage of this tool?  It seems that every time I load a PivotView, the memory footprint of my application increases, seemingly w/o end (which, as a developer doesn't seem to make sense...why doesn't it just reuse the same memory space/objects)?

    Do you have any other (programmatic) recommendations (other than those already listed on your site) for managing these memory issues (objects that we can clean up, dispose of, etc)?


  • Replied 3 August 2017, 4:00 pm EST

    I'm not looking to be argumentative, but this isn't exactly a feature request....this is a show stopper of an issue for us. It seems to me that the product has a memory leak (I've never worked with any other tool where unfettered memory allocation was described as an 'expected' behavior). It's not as if my query results are too large, it's that running the same query over and over (which is what my users would do) eventually uses up all available resources.
  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    My apologies for the inconvenience caused. I understand your concerns regarding this behavior, I have requested the Product Manager to take this case on priority and also passed on your comments regarding this behavior . Since your email is already added to the list of users affected by this case, you will be notified as soon as the case gets implemented.

    I would like also like you to know that case 162380 has being entered as a Bug case in our system not as a feature case as I had mentioned in my last post.

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    Sdioxn,



    This is an expected behavior since Active Analysis stores all the
    records in
    memory during save and load operations .This memory will not be released
    untill the next save and load operation. You will need to restart your
    application to resolve this. Unfortunately, I am unable to recommend any
    additional recommendations apart from the ones that are listed in this link for managing memory issues.

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    I'm sorry to keep going back and forth on this, but I want to make sure I completely understand what you are saying.



    In my particular implementation right now (PivotView in an asp.net 4.0 web page, 64-bit apppool, integrated pipeline, using a relational datasource, and an autogenerated schema)...everytime I run my page with the PivotView on it, my memory usage goes up by ~200MB. Eventually, let's say if I navigate to (or refresh) my page ~100 times, my machine runs out of physical memory.



    1) This is expected behavior by the PivotView and/or it's underlying relational datasource (the memory footprint of the session/application continually going up, with seemingly no reuse/recovery of the memory/objects already created for/used by this page)?



    2) The *only* ways to reclaim this memory is for the session to either timeout or be abandoned (and GC to run), or to restart the application?
  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    I would like to answer your questions in the order that you have asked.

    1) This is expected behavior by the PivotView and/or it's underlying
    relational datasource (the memory footprint of the session/application
    continually going up, with seemingly no reuse/recovery of the
    memory/objects already created for/used by this page)?

    Ans:Yes,this is an expected behavior .


    2.The *only* ways to reclaim this memory is for the session to either
    timeout or be abandoned (and GC to run), or to restart the application?

    Ans: Yes, the only ways are either the session to timeout or abandoned or restart the application.


    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    I have entered a feature case 162380(As a Developer I would like GCAA to  provide some way to free memory resources without waiting for session to terminate) to address your concerns .I have also added your email address as an affected user to this case.

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    Your developers need to reconsider such an implementation. Putting a button on the page to clean up server side memory is ridiculous. Why would I even consider putting that functionality in the hands of my end user? How would they have any idea when to hit that button? In my opinion, your product's current memory management implementation is extemely flawed. I do hope you come up with another alternative, in very short order.
  • Replied 3 August 2017, 4:00 pm EST

    sdixon,

    My apologies for the inconvenience caused, I would like you to know that placing the code to dispose off ActiveAnalysis objects in the click of a button was only a suggestion to demonstrate a simple implementation of this code.Please note that placing the code to dispose of these objects is dictated by your business logic of the application where ActiveAnalysis is used. You will need to use this code if and when you feel that disposing the objects is required (as per your business logic).

    In case you are unable to ascertain where you need to place this code so that it works correctly, please send us your sample application along with the Cube so that we may help you accordingly.

    Best Regards,
    Abhishek




  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    I just got an update for case 162380 and our development team has suggested the following code to dispose of memory. Please try the following code and let me know if it works for you.

    pv.DataSource.Dispose();

    GC.Collect();

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    What event does your dev team suggest that this code be placed in? I've tried it in several places, and the issue still persists.
  • Replied 3 August 2017, 4:00 pm EST

    sdixon,

    I have forwarded your comments the developmnet team . I will get back to you with further updates on the same.

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    Sdixon,

    Our developers have suggested to add a button to the page and then place the code to dispose of the memory in the click event of this button. In case you are still facing issues then could you please send us your sample so that I can request our developmnet team to look into it.

    Best Regards,
    Abhishek
  • Replied 3 August 2017, 4:00 pm EST

    sdixon,

    I have attached a sample application for you to demonstrate how Active Analysis collects memory. This sample uses a local cube datasource ,you will need to copy a local cube created at your end to the root folder and change the file name for the cube accordingly in "MyLocalCubeFilePath" property.

    After you have done this, please open the Windows Task Manager  and observe the Memory consumption in the performance tab when the following actions are performed.


    1. Before the Page gets loaded



    2. After the page is loaded



    3. After you have Clicked on "Load DataSource From LocalCube" button  to bind the datasource from local cube
    file.



    4. After you have dragged a Measure to the Column Shelf



    5. After you have clicked on the "Release Memory" button to release memory.

    The expected behavior is that you should see that the Memory consumption comes down after you have clicked on the Release memory button.

    Best Regards,

    Abhishek



    2012/06/DataSourceSample.zip
  • Replied 3 August 2017, 4:00 pm EST

    Unfortunately, my project and database are too complex to provide a useful example. Perhaps your developers can provide me with one of your existing samples, with this workaround incorporated in a way that would reflect a real world implementation? Or they can provide the sample code that led them to believe that this workaround actually works (because, despite whatever event I put this workaround into, memory usage still grows w/o end)?
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels