Page 1 of 2

LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Fri 25 Apr 2014 14:50
by AKRRKA
Hi,

There was a very troublesome problem with memory leaks. Arose long ago, but managed to show stable in the test just now. This problem exists in all previous versions.

Prepared for the demonstration test project and database. Also attach result of profiling memory.

Leak arises not at once. From 30 minutes to several hours, is that everything works fine and suddenly at some moment memory leaking. Problem very seriously.
Huge request as soon as possible to resolve it or give recommendations how to avoid.

Source Database Screenshots.rar.zip (44.8 МБ)
http://rghost.ru/54611871
Password send to support.

ANTS Memory Profiler Results - ContextStressTest-2014.04.25-16.35.rar (226.17 MB)
http://www.multiupload.nl/Z9B1NKWHFV
Password send to support.

Screenshots:
Link to full image - 1
Image

Link to full image - 2
Image

Related topics:
LinqConnect Professional Version 4.2.222 (04-Apr-2013) - One Model with many DataBase
LinqConnect Professional Version 4.1.184 (07-Feb-2013) - access from two and more thread

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Tue 29 Apr 2014 13:33
by MariiaI
Thank you for the sample project and test results. We will investigate the issue with memory leaks in more details and contact you when any results are available.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Tue 06 May 2014 10:42
by AKRRKA
Any news?
You can reproduce the leak and find the reason?

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Wed 07 May 2014 11:42
by MariiaI
We are investigating this issue. We will post here about the results as soon as possible.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Thu 05 Jun 2014 08:38
by AKRRKA
You could get a memory leak on my example?
Can I help you with something else?
May be required any additional information?

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Fri 06 Jun 2014 10:34
by MariiaI
We have managed to reproduce this issue a couple of times. However, this error is not permanent. The investigation of this behavior could take some time. If we'll need more information/details, we will definitely contact you.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Mon 09 Jun 2014 06:57
by AKRRKA
In my example, I can reproduce the memory leak in 100% of cases, at each start of the test (sometimes requires less time and sometimes more), three of my computers.
And unfortunately all of my clients who use our commercial program.
I very much hope to fix memory leaks in the next version.
Feel free to contact me. I will be happy to assist you.
Thanks.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Thu 12 Jun 2014 10:03
by MariiaI
We are working on the issue. We will post here about the results as soon as any are available.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Wed 18 Jun 2014 10:31
by AKRRKA
Thank you. For me it is a very serious problem.
Memory leak does not implement the required functionality in the program.
It is waiting for the good news.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Mon 21 Jul 2014 19:26
by AKRRKA
Any news?

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Thu 24 Jul 2014 08:11
by Shalex
The investigation is in progress. We will post here about the results as soon as any are available.

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Fri 29 Aug 2014 14:42
by AKRRKA
Can I help you?

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Tue 02 Sep 2014 12:36
by MariiaI
The investigation is in progress and it could take some time due to the technical reasons. If we'll need more information/details, we will contact you and we will definitely inform you when any results regarding this issue are available.

LinqConnect Professional Version 4.4.582 (11-Sep-2014) - Memory Leak

Posted: Fri 26 Sep 2014 06:48
by AKRRKA
Hello.

I tested the latest version of the components LinqConnect Professional Version 4.4.582 (11-Sep-2014).
And the problem has become even more. A memory leak has become a huge and began to appear at once at the start of the test.
Repeated with 100% probability.

To simplify the test, I removed the a lot of requests and kept that at least 100% which causes a memory leak.
In addition, the project I was a little changed and simplified.
Has changed the way to create the context and its removal.

That's part of the code:

Code: Select all

using System;
using System.IO;
using System.Reflection;
using Devart.Data.Linq;
using Devart.Data.Linq.Mapping;

namespace ceData.Context
{
    public class Service
    {
        private Stream _contextStream;
        private MappingSource _mappingSource;
        private ceDataContext _dataContext;

        public ceDataContext CreateDataContext(string sProviderPrefix, string sConnectionString)
        {
            _contextStream = Assembly.GetExecutingAssembly()
                        .GetManifestResourceStream("ceData.Context.ceDataContext" + sProviderPrefix + ".xml");
            _mappingSource = XmlMappingSource.FromStream(_contextStream);
            _dataContext = new ceDataContext(sConnectionString, _mappingSource);

            _dataContext.Connection.Open();

            return _dataContext;
        }

        public void DisposeDataContext()
        {
            _dataContext.Connection.Close();
            _dataContext.Dispose();
            _dataContext = null;

            _contextStream.Close();
            _contextStream = null;

            _mappingSource = null;
        }
    }
}
And here is a memory leak:

Code: Select all

        void SelectData(object data)
        {
            var comObjectId = (int)data;

            var service = new ceData.Context.Service();
            var cx = service.CreateDataContext(_providerPrefix, _connectionString);

            var concentrators = cx.Concentrators.Select(c => c);

            foreach (var con in concentrators)
            {

                var concentratorMeters = cx.Concentrators_Meters
                            .Where(c => c.Concentrator == con && c.IsCurrent && c.Meter.ComObjectId == comObjectId)
                            .Select(c => c.Meter);
                var dataType = cx.RefDataTypes.SingleOrDefault(dt => dt.DataTypeId == 3);

                dataType = null;
                concentratorMeters = null;
            }

            concentrators = null;

            service.DisposeDataContext();
        }
Without a foreach loop with sample data no leaks. Judging by the result of the profiler, the whole problem in the cache. The cache is not destroyed, but remains in the memory and there is a large memory leak.

However, as you can see all these actions do not help.
Very much I ask fix the problem as soon as possible.

That data for analysis.

The project with source code and database backup for MySQL (password for the archive sent separately).

ContextStressTest(Source+Database).exe.rar
48,7 MB (51 135 794 byte)
CRC32: 0B4E0B1B
MD5: 8628F51E759399C61F49C132FD93929D
SHA-1: 80EDAF698F1E97E6505031725C167DB8FDD873C8
http://nashdisk.ru/ab4650

Test results:

All archived programs WinRar 5.11, format RAR5 (older versions of WinRar does not support this format).

ceContextStressTest [2014-09-25] [17-53].Red Gate ANTS Memory Profiler 8
ceContextStressTest [2014-09-25] [17-53].Red Gate ANTS Memory Profiler 8.rar
505 MB (529 894 086 byte)
CRC32: 802C7F0A
MD5: EBA9B11602C7F37D99F5B703C1B7A103
SHA-1: C6B0E9C616428EBC12753BEFF965F9E054A41141
http://nashdisk.ru/2b3328

ceContextStressTest [2014-09-25] [17-53].Red Gate ANTS Memory Profiler 8.png
Image

ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0
ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0.part1.rar
450 MB (471 859 200 byte)
CRC32: 1884B9A5
MD5: 7F3E2CA1A36873AA17E856D9819CD6C5
SHA-1: 647A830111C190B1083EE9FC75A1FFA713566D6F
http://nashdisk.ru/e2a9d5

ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0.part2.rar
450 MB (471 859 200 byte)
CRC32: E4A44884
MD5: 71319045B795DD3612E2E35D7C75A610
SHA-1: E08898C2F2F01DA0D977F98D868F2A85FBF07830
http://nashdisk.ru/89a62b

ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0.part3.rar
450 MB (471 859 200 byte)
CRC32: 82AC2DA6
MD5: 91CBD0402280AB2CF81C7911EE5996C9
SHA-1: 9671729CF7432C8E95A706385E84FB86B52732A0
http://nashdisk.ru/047cc8

ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0.part4.rar
229 MB (241 121 341 byte)
CRC32: 6A200F1E
MD5: 293C4DA9D06FDBB692DA10212B5A3872
SHA-1: 0951E5C36020E715E408055586AD158BE5FD3E93
http://nashdisk.ru/4d16de

ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0 - 1.png
Image

ceContextStressTest [2014-09-25] [16-43].Jetbrains dotMemory 4.0 - 2.png
Image

ceContextStressTest [2014-09-25] [11-22].Jetbrains dotMemory 4.0
Only screenshots, since the size of the result of the profiler is very large.

ceContextStressTest [2014-09-25] [11-22].Jetbrains dotMemory 4.0 - 1.png
Image

ceContextStressTest [2014-09-25] [11-22].Jetbrains dotMemory 4.0 - 2.png
Image

ceContextStressTest [2014-09-25] [11-22].Jetbrains dotMemory 4.0 - 3.png
Image

ceContextStressTest [2014-09-25] [11-22].Jetbrains dotMemory 4.0 - 4.png
Image

ceContextStressTest [2014-09-25] [11-22].Jetbrains dotMemory 4.0 - 5.png
Image

Re: LinqConnect Professional Version 4.4.453 (06-Mar-2014) - Memory Leak

Posted: Wed 01 Oct 2014 13:26
by MariiaI
Thank you for new test project. We will investigate it and contact you as soon as possible.