Last three memory leak!

delphi package - automated exception handling
Post Reply
sbela
Posts: 1
Joined: Fri Apr 06, 2018 12:22 pm

Last three memory leak!

Post by sbela »

Hi! Can anyone help me to find my last three memory leak ?
Thanks in advance!
LogViewer.exe is my application

Code: Select all

allocation number: 3440
program up time: 1,33 s
type: Thread Handle
handle: $a6c
access rights: $1fffff
threadId: $4688
processId: $b18
process exe: C:\src\logviewer\Output\LogViewer.exe

main thread ($36fc):
671cdb6a madExcept32.dll madExceptDbg 3805 CreateThreadCallback
00461ea3 LogViewer.exe   madExcept         HookedCreateThread
742fb014 ucrtbase.dll                      _beginthreadex
0faf4aad mfc140.dll                        #3627
0faf46a2 mfc140.dll                        #2165
0ff039c0 logvd.dll                         LogViewerCallThisAtStartup
0063a04e LogViewer.exe   LogViewer     308 initialization
76c58652 KERNEL32.DLL                      BaseThreadInitThunk

Code: Select all

allocation number: 3436
program up time: 1,31 s
type: Thread Handle
handle: $a58
access rights: $1fffff
threadId: $3440
processId: $b18
process exe: C:\src\logviewer\Output\LogViewer.exe

main thread ($36fc):
671cdb6a madExcept32.dll madExceptDbg 3805 CreateThreadCallback
00461ea3 LogViewer.exe   madExcept         HookedCreateThread
742fb014 ucrtbase.dll                      _beginthreadex
0faf4aad mfc140.dll                        #3627
0faf46a2 mfc140.dll                        #2165
0ff039c0 logvd.dll                         LogViewerCallThisAtStartup
0063a04e LogViewer.exe   LogViewer     308 initialization
76c58652 KERNEL32.DLL                      BaseThreadInitThunk

Code: Select all

allocation number: 2452
program up time: 305 ms
type: Thread Handle
handle: $9c0
access rights: $1fffff
threadId: $4424
processId: $b18
process exe: C:\src\logviewer\Output\LogViewer.exe

main thread ($36fc):
671cdb6a madExcept32.dll madExceptDbg  3805 CreateThreadCallback
00461ea3 LogViewer.exe   madExcept          HookedCreateThread
0049a65a LogViewer.exe   Graphics      6724 InitScreenLogPixels
0049ac05 LogViewer.exe   Graphics      6896 initialization
00404e5a LogViewer.exe   System       10853 InitUnits
00404ebe LogViewer.exe   System       10918 @StartExe
00407aa2 LogViewer.exe   SysInit        668 @InitExe
006395a4 LogViewer.exe   LogViewer      109 initialization
76c58652 KERNEL32.DLL                       BaseThreadInitThunk
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Last three memory leak!

Post by madshi »

These are all thread handle leaks, not memory leaks.

Two of these seem to be caused by logvd.dll calling some MFC functionality, which then creates a secondary thread, and that secondary thread still seems to be running. Or at least the thread handle was never freed.

The 3rd one seems to originate from Graphics.InitScreenLogPixels. Not sure if a thread is created there? You'd have to check the Graphics.pas source code for the Delphi version you're using.

In any case, I'm not sure if you can do anything about these leaks. They might even be intentional. E.g. if the MFC threads are simply still running, it might be by design.

Generally, IMHO leaks are only a real problem if they're either extremely large, or if they cumulate over the runtime of your application.
Post Reply