Delphi 64 Bit memory leaks not clearing?

delphi package - automated exception handling

Delphi 64 Bit memory leaks not clearing?

Postby mattg » Fri May 15, 2020 2:57 am

Calling this:

MadExcept.ClearLeaks(False,false);
Then
MadExcept.ReportLeaksNow(False);

Would expect this to return no leaks instead we are getting "Filtering child leaks" dialog in bottom right and this takes a very very long time - never seen it complete yet.

App is quite large, tried in 32bit and get the same.

Any thoughts?

Regards
Matt
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Fri May 15, 2020 3:17 am

The objective is to be able to capture "running" leaks where we might be adding to a list and not freeing until shutdown for example. Normal detect memory leaks on shutdown does not capture these kinds of errors.
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby madshi » Tue May 19, 2020 12:45 pm

madshi
Site Admin
 
Posts: 10274
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Wed May 20, 2020 8:14 am

madshi wrote:Does this build fix it?

http://madshi.net/madCollectionUpdate.exe


Thankyou, will check and let you know in next day or so.
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Thu May 21, 2020 8:20 am

So original problem is still present still says "Filtering child leaks" even if i enter this after application.initialize (should be nothing to look at);
MadExcept.StopLeakChecking(False);

Theoretically there should be very limited new leaks when I do this:

MadExcept.ClearLeaks(False,false);
MadExcept.ReportLeaksNow(False);

After testing on a small 64bit app it seems to work ok. I get a few "leaks" from the creation of the report only. But that takes a second or two so not "instant" so im wondering if its still sorting through alot of objects or items when cleared still?

With large app - clear then report - CPU core maxes and its busy doing something - for a long time.

I have not yet seen it complete.

With leak reporting on the "big" app is only running 550MB (normaly 230MB or so without madexcept leak checking) in memory so not huge by 64bit standards. When i do a ClearLeaks(False,false) memory usage remains unchanged? would have expected it to shrink somewhat?

Any ideas from the above?
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby madshi » Thu May 21, 2020 8:27 am

Is it the ClearLeaks or the ReportLeaksNow which takes such a long time? I suppose it's the ReportLeaksNow, correct? Is there an easy way for me to reproduce the problem? I don't have any monstrously sized Delphi projects to test this with, especially not 64bit capable ones.
madshi
Site Admin
 
Posts: 10274
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Fri May 22, 2020 2:08 am

ReportLeaksNow is what is taking a disproportionate amount of time.

Attached a test, this is a "tiny" app but takes 11 sec to process child leaks the first time (on an i7 8700k), then near instant the second time in same instance.

That not running in IDE either, that does not seem to change the time taken.

I think this will highlight the issue for you.

Same for 32bit and 64bit so i don't think that is the problem being 64bit only.

Run app then tap ClearAndReportLeaks button. Then tap a second time to see it much faster.

Please let me know what you see.

this is in delphi 10.2.3
Attachments
SlowLeaks2.zip
(62.02 KiB) Downloaded 123 times
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Wed May 27, 2020 8:23 pm

Any updates on this?
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby madshi » Thu May 28, 2020 9:54 pm

Sorry, busy adding support for Delphi 10.4 right now. Will look into this soon.
madshi
Site Admin
 
Posts: 10274
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Fri May 29, 2020 8:59 pm

Thankyou please do, would like to deploy with this test in place as we are having an issue with running memory use. These issues are hard to track with a large app.
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Thu Jun 11, 2020 10:01 pm

Any chance you can bump this up your Todo list, either that or release source code so I can fix it? i really do need to use this feature. (Its why i bought mad except) But it does not work.
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Fri Jun 19, 2020 12:13 am

here we are 1 month later... can we please have this fixed urgently.
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby madshi » Fri Jun 19, 2020 7:38 pm

I'm so sorry for taking so long. Will try to get this done early next week.
madshi
Site Admin
 
Posts: 10274
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby mattg » Fri Jun 19, 2020 8:00 pm

many thanks I do need this looked at asap.
mattg
 
Posts: 17
Joined: Thu Apr 27, 2017 11:25 pm

Re: Delphi 64 Bit memory leaks not clearing?

Postby madshi » Mon Jun 22, 2020 12:32 pm

So here's a new build:

http://madshi.net/madCollectionUpdate.exe

I've double checked the code and calling "ClearLeaks()" only marks the leaks as being no leak. But they're still checked for parent/child leaks. I'm not 100% sure why I've done this, to be honest, but I suppose that I must have had a good reason and I'm scared to break something. So instead now I've added this new API to madExcept.pas:

Code: Select all
// Do you want child leaks to be filtered (can be very slow)?
procedure SetChildLeakFiltering (doFiltering: boolean);

Calling this in addition to ClearLeaks() should make things fast for you.
madshi
Site Admin
 
Posts: 10274
Joined: Sun Mar 21, 2004 5:25 pm

Next

Return to madExcept

Who is online

Users browsing this forum: No registered users and 20 guests