XLSX comparison causes memory leak!

Using c# and latest version of Groupdocs Comparison, our service hangs on the Compare method using following files and code:

using (MemoryStream sourceStream = new MemoryStream(sourcePdfFile))
{
    using (Comparer comparer =
           new Comparer(sourceStream))
    {
        using (MemoryStream targetStream = new MemoryStream(targetPdfFile))
        {
            comparer.Add(targetStream);
            using (MemoryStream outputStream = new MemoryStream())
            {
                CompareOptions compareOptions = new CompareOptions
                {
                    GenerateSummaryPage = false,
                    DetectStyleChanges = true,
                    DetalisationLevel = DetalisationLevel.Middle,
                    DeletedItemStyle = new StyleSettings()
                    {
                        IsStrikethrough = true,
                        FontColor = Color.Red
                    },
                    InsertedItemStyle = new StyleSettings()
                    {
                        IsUnderline = true,
                        FontColor = Color.Green
                    }
                };

                comparer.Compare(outputStream, new SaveOptions()
                {

                }, compareOptions);

memoryleak.zip (74.8 KB)

This is quite urgent as we run our service in production!

1 Like

@Verthosa
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): COMPARISONNET-4472

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

HI @Verthosa ,
Thank you for sharing the sample files and reporting the issue.

We were able to reproduce the behavior on our side. It appears that the library hangs during comparison due to a merged cell in the original Excel file (cell A30), which spans all columns in row 30. As a quick test, we unmerged cell A30, and the comparison completed successfully.

Our team is investigating the issue, and we’ll let you know as soon as a new version is released with a fix.

1 Like

hi @Verthosa ,
Just wanted to let you know that we’ve released GroupDocs.Comparison for .NET version 25.7, which includes a fix for the issue you reported.

You can find the full release notes here:

Please let us know if you have any further questions or feedback.

1 Like

Great! big thanks!