Bug Report T299682
Visible to All Users

Scripting - The ScriptingReport object isn't disposed of after the GC.Collect method call if the XtraReport.DataSource property value is assigned in scripts

created 9 years ago

Hello DevExpress Team,

In our application report DataSource is assigned in the Report.DataSourceDemanded script. I noticed that objects assigned as a DataSource are not being GC'ed at all. I tried use memory profiler to determine the cause of the issue, but the only conclusion I have derived is that these objects are holding by the ScriptingReport instance which is not GC'ed too. I prepared a sample project demonstating this issue in action. There are two equivalent reports in the project: CodeBehindReport and ScriptReport. The only difference between them is the way the Report.DataSource property is initialized. In the first one it's initialized in code-behind, in the second one - in script. Below you'll find steps to reproduce the issue:

  1. Open and lauch attached project
  2. Click the "Build simple report" button - "Leaked 0 Person instances" message box has to be shown. It indicates that all two Person instances has been GC'ed.
  3. Click the "Build script report" button - "Leaked 2 Person instances" message box has to be shown.

Is there any fix/workaround for this issue (except of not assigning DataSource from scripts)?

Wish you have a great day,
Khindikaynen Aleksey

Comments (1)
Dmitry Tokmachev (DevExpress) 9 years ago

    Hello Aleksey,

    Thank you for pointing out this issue and providing us with detailed research results.

    I was able to reproduce this behavior on our side and forwarded this thread to our R&D team for further research. As a temporary workaround to this issue, wrap the creation of the ScriptReport into the 'using' statement:

    C#
    new Action(() => { using (var report = new ScriptReport()) { report.CreateDocument(false); }  })();

    Thanks,
    Dmitry

    Answers approved by DevExpress Support

    created 9 years ago (modified 9 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Show previous comments (1)
      DevExpress Support Team 9 years ago

        Hi Aleksey,

        We applied additional changes, so the issue should be fixed now. Please re-request a hotfix using the link above.

        ED ED
        EZClaim Development 9 years ago

          Are these hotfixes light weight, like i would only have to deploy a minimal # of replacement dlls or would a whole new set be required? If the hotfix would allow me to deploy a subset of the dlls, can I have access to this hotfix?

          I believe I am encountering this issue, but I am on 15.1.7.0. If I have to deploy a whole new set of dll, I will just go to 15.1.X.

          Dmitry Tokmachev (DevExpress) 9 years ago

            Hello,
            Let me explain our hotfix concept. We fixed this issue in version 15.1.8, and this version was already released. So, it's possible to update to v15.1.8 to make this functionality operate as expected. In general, any hotfix is a daily build of our components that includes bug fixes and implemented features from previous builds and I'm afraid that it's not possible to replace only the necessary assemblies to overcome this issue.

            Thanks,
            Dmitry

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.