Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak error and uses unit in Advanced demo, can point to component code error? #656

Closed
RicardoBer opened this issue Sep 14, 2016 · 6 comments
Assignees
Milestone

Comments

@RicardoBer
Copy link

Hello,

Testing with Advanced demo, first I recive and error in "System.ImageList" unit in GeneralAbilitiesDemo.pas, it is not a problem it is enought if I remove the unit, all works, but when I close the application it fires memory bugs, some times a lot of them.

Before I use this example and I did not recive this, the it is possible that the memory leak are in components?.

This images are from 2 executions

image

@sanjayssk
Copy link
Contributor

sanjayssk commented Sep 15, 2016

I also got this yesterday but with fewer errors. I didn't have time to investigate and it hinted at starting with a fresh pull. I will look again today.

Update: This is strange. I went back to an old commit (Sep 6, full repository) and the problem still appears. This problem was not there when I had used the demo while making that commit. This is quite puzzling and doesn't make sense. Any ideas?

@sanjayssk
Copy link
Contributor

Seems to be spurious and false error according to certain threads on google. I will ignore it for now unless someone gives more information in this thread on how to switch it off or diagnose further.

@joachimmarder
Copy link
Contributor

This is the MadExcept report:

allocation number: 32682
program up time: 11,90 s
type: UnicodeString
address: $5227b10
size: 24
access rights: read/write
code page: 1200
reference counter: 1
string length: 5
contents: ㋥㋦㋧㋨㋩

main thread ($2240):
671cd4ce madExcept32.dll madExceptDbg          1603 GetMemCallback
00406e9c Advanced.exe    System                     @GetMem
0040a67a Advanced.exe    System                     @NewUnicodeString
0040ab07 Advanced.exe    System                     @UStrAsg
00712fd0 Advanced.exe    GeneralAbilitiesDemo   253 TGeneralForm.VST2InitNode
006c1c50 Advanced.exe    VirtualTrees         20384 TBaseVirtualTree.DoInitNode
006c7608 Advanced.exe    VirtualTrees         22894 TBaseVirtualTree.InitNode
006d3358 Advanced.exe    VirtualTrees         28332 TBaseVirtualTree.GetNextVisible
006d8546 Advanced.exe    VirtualTrees         30730 TBaseVirtualTree.PaintTree
006c98e3 Advanced.exe    VirtualTrees         23802 TBaseVirtualTree.Paint
00599f7f Advanced.exe    Vcl.Controls               TCustomControl.PaintWindow
00593ee5 Advanced.exe    Vcl.Controls               TWinControl.PaintHandler
005946d4 Advanced.exe    Vcl.Controls               TWinControl.WMPaint
00599f19 Advanced.exe    Vcl.Controls               TCustomControl.WMPaint
006bc07b Advanced.exe    VirtualTrees         17591 TBaseVirtualTree.WMPaint
0058f1ce Advanced.exe    Vcl.Controls               TControl.WndProc
00593d19 Advanced.exe    Vcl.Controls               TWinControl.WndProc
006cd9cb Advanced.exe    VirtualTrees         25545 TBaseVirtualTree.WndProc
00593338 Advanced.exe    Vcl.Controls               TWinControl.MainWndProc
00535b0c Advanced.exe    System.Classes             StdWndProc
76f48e54 ntdll.dll                                  KiUserCallbackDispatcher
759062fb user32.dll                                 DispatchMessageW
0066a413 Advanced.exe    Vcl.Forms                  TApplication.ProcessMessage

The second leak:

allocation number: 34695
program up time: 13,57 s
type: UnicodeString
address: $887e0d8
size: 46
access rights: read/write
code page: 1200
reference counter: 1
string length: 16
contents: no template used

main thread ($2240):
671cd4ce madExcept32.dll madExceptDbg    1603 GetMemCallback
00406e9c Advanced.exe    System               @GetMem
0040a67a Advanced.exe    System               @NewUnicodeString
0040ab07 Advanced.exe    System               @UStrAsg
00709d63 Advanced.exe    PropertiesDemo   110 TPropertiesForm.VST3InitNode
006c1c50 Advanced.exe    VirtualTrees   20384 TBaseVirtualTree.DoInitNode
006c7608 Advanced.exe    VirtualTrees   22894 TBaseVirtualTree.InitNode
006d3358 Advanced.exe    VirtualTrees   28332 TBaseVirtualTree.GetNextVisible
006d8546 Advanced.exe    VirtualTrees   30730 TBaseVirtualTree.PaintTree
006c98e3 Advanced.exe    VirtualTrees   23802 TBaseVirtualTree.Paint
00599f7f Advanced.exe    Vcl.Controls         TCustomControl.PaintWindow
00593ee5 Advanced.exe    Vcl.Controls         TWinControl.PaintHandler
005946d4 Advanced.exe    Vcl.Controls         TWinControl.WMPaint
00599f19 Advanced.exe    Vcl.Controls         TCustomControl.WMPaint
006bc07b Advanced.exe    VirtualTrees   17591 TBaseVirtualTree.WMPaint
0058f1ce Advanced.exe    Vcl.Controls         TControl.WndProc
0058fafa Advanced.exe    Vcl.Controls         TControl.WMMouseMove
0058f1ce Advanced.exe    Vcl.Controls         TControl.WndProc
00593d19 Advanced.exe    Vcl.Controls         TWinControl.WndProc
006cd9cb Advanced.exe    VirtualTrees   25545 TBaseVirtualTree.WndProc
00593338 Advanced.exe    Vcl.Controls         TWinControl.MainWndProc
00535b0c Advanced.exe    System.Classes       StdWndProc
76f48e54 ntdll.dll                            KiUserCallbackDispatcher
759062fb user32.dll                           DispatchMessageW
0066a413 Advanced.exe    Vcl.Forms            TApplication.ProcessMessage

@joachimmarder
Copy link
Contributor

Reason is that the node-data is not explicitly allocated and deallocated (using Dispose()), see e.g. http://forum.madshi.net/viewtopic.php?f=4&t=28177

Possible resolution could be to use objects instead of records, or to call Finalize() on the record.

@sanjayssk
Copy link
Contributor

That's news to me. Thanks. But what I don't understand is, why am I seeing that message now. I didn't see it earlier. Has something changed in the demos or in the project settings?

@joachimmarder
Copy link
Contributor

Yes, I turned on mem leak reporting: 2ae1d51

@joachimmarder joachimmarder added this to the Version 6.4 milestone Sep 18, 2016
sanjayssk pushed a commit that referenced this issue Sep 20, 2016
* Many of the forms were not using the event OnFreeNode to release node data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants