Memory Leaks in AC 14.27

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #38309
    HeDiBo
    Participant

    In acAlphaImageList there's this code:

    Code:
    procedure TsCharImageList.DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer; Style: Cardinal; Enabled: Boolean);
    var
    Bmp, SrcImage: TBitmap;
    begin
    if HandleAllocated and IsValidIndex(Index, Items.Count) then begin
    Bmp := CreateBmp32;//(Width, Height);
    if Bmp <> nil then
    try
    Bmp.Canvas.Lock;
    if Items[Index].Color = clNone then
    ForeColor := Canvas.Font.Color;

    SrcImage := Items[Index].GetImage; //<<<< May produce a memory leak
    Bmp.Height := SrcImage.Height;
    Bmp.Width := SrcImage.Width;

    In acPopupController the initialization

    Code:
    initialization
    rShadowBmp := MakeShadow($44000000, 17, 2, 8, 0, 0);

    may create a TBrush which is not freed when rShadowBmp is freed

    This is the memory leak report:

    [attachment=9404:WIP4_MemoryManager_EventLog.txt]

    #59725
    Support
    Keymaster

    Thank you for the report, I will check it.

    #59733
    SzakiLaci
    Participant
    'HeDiBo' wrote:

    may create a TBrush which is not freed when rShadowBmp is freed

    Do you think this can affect sPageControl component too?

    Currently it has a huge memory leak too >> whenever hoovering the mouse over TABs, it creates a new BMP + Brush +++ never freed.

    (3-600 of them pro minute, if someone is actively moving the mouse)

    It completely ruined my APP, users calling me every day…

    Reported the problem a week ago, no fix yet.

    (WTF is happening to Serge lately ???)

    #59735
    Support
    Keymaster

    Hello

    Which tool do you use for checking of memory leaks?

    I'm trying to repeat these leaks in tests, but can't. Maybe something should be changed. Can you help me to repeat it?

    #59737
    HeDiBo
    Participant

    FastMM4_FullDebugMode.dll

    You must use FastMM4 as the first line in uses in dpr file:

    Code:
    program SomeProgram;
    uses
    FastMM4,
    MidasLib,
    Vcl.Forms,

    I use these options:

    [attachment=9410:FastMM4Options.zip]

    My memory leak occurs when I change a skin programmatically.

    #59738
    Support
    Keymaster

    I'm sorry Dick, my message was addressed to SzakiLaci.

    I can send you new files where your reported memory leak is removed (by PM).

    #59739
    SzakiLaci
    Participant
    'Support' wrote:

    I'm sorry Dick, my message was addressed to SzakiLaci.

    I can send you new files where your reported memory leak is removed (by PM).

    Thanks for the reply!

    Yes, I'm using FastMM4 too.

    It is strongly recommended for Delphi7.

    But program's memory usage is increasing too, (measuring with Process Hacker), so it's definitely not a “false alarm” of FastMM4 debugger.

    I'll create a DEMO.

    #59741
    Support
    Keymaster
    'SzakiLaci' wrote:
    I'll create a DEMO.

    Thanks

    #59742
    SzakiLaci
    Participant

    [attachment=9411:PageControl_MemLeak.zip]

    move mouse up and down many times on the tabs, so they highlight for a moment.

    #59743
    HeDiBo
    Participant
    'Support' wrote:

    I'm sorry Dick, my message was addressed to SzakiLaci.

    I can send you new files where your reported memory leak is removed (by PM).

    That's not necessary, I'll await the next release.

    #59744
    Support
    Keymaster

    SzakiLaci, I think, your memory leak is not linked with PageControl, reason is same as in a leak reported by HeDiBo (ImageList with disabled UseCache property).

    I think, this memory leak is removed already, changes will be available in the nearest release.

    #59746
    SzakiLaci
    Participant
    'Support' wrote:

    SzakiLaci, I think, your memory leak is not linked with PageControl, reason is same as in a leak reported by HeDiBo (ImageList with disabled UseCache property).

    I think, this memory leak is removed already, changes will be available in the nearest release.

    Upgraded to v14.28

    Memory leak is STILL THERE! Also in the DEMO app I've uploaded for you.

    To reproduce the problem you can simply:

    1.) move the mouse up & down & up & down …. over the pagecontrol's TABs

    or

    2.) scroll the whole window up & down

    #59747
    SzakiLaci
    Participant

    [attachment=9415:sPageCtrl_Memory_leak2.jpg]

    The problem happens both with and without FastMM4 unit.

    #59748
    SzakiLaci
    Participant

    This fixed 🙂

    Code:
    2196: if not CanUseCache or not FUseCache then
    2197: FreeAndNil(IcoBmp);

    You can close the topic.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.