1

I'm having memory leaks with every application running on a device with a Touch Screen capability. If I use only the mouse and keyboard, everything is fine. Memory leaks occur if I touch the application, it can be any gesture from tapping on a button to moving the form.

I'm using Delphi DX and I tested the issue on a Windows 10.

The application tested has nothing more than a TButton and a TEdit.

Here is the memory leaks report:

5 - 12 bytes: TDictionary<System.string,System.Generics.Collections.TList<FMX.Forms.TApplication.TFormRegistryItem>>.TKeyCollection x 1, TIdleMessage x 1, Unknown x 3
13 - 20 bytes: TApplication.TFormRegistryItem x 1, TApplicationFormFactor x 1, Unknown x 1
21 - 36 bytes: UnicodeString x 1
37 - 52 bytes: TList<FMX.Forms.TApplication.TFormRegistryItem> x 1, TDictionary<System.string,System.Generics.Collections.TList<FMX.Forms.TApplication.TFormRegistryItem>> x 1, TDictionary<FMX.Types.TWindowHandle,FMX.Platform.Win.TUpdateRects> x 1, TDictionary<FMX.Forms.TCommonCustomForm,FMX.Platform.Win.TFullScreenParams> x 1, TDictionary<System.Integer,System.NativeUInt> x 1, TDictionary<System.NativeUInt,FMX.Platform.Win.TWin32MenuInfo> x 1, TList<FMX.Platform.Win.TWin32TimerInfo> x 1, TList<System.Classes.TComponent> x 1
53 - 68 bytes: Unknown x 2
69 - 84 bytes: Unknown x 1
85 - 100 bytes: TMultiTouchManagerWin x 1
181 - 212 bytes: TPlatformWin x 1
213 - 244 bytes: TApplication x 1

Steps to reproduce:

  • Create a Multi-Device application.
  • Put a button on the form.
  • Run the application on a device with Touch Screen capability.
  • Click the button by tapping on the screen.
  • Close the application.

You should get a memory leak report.

The form code:

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs;

type
  TForm1 = class(TForm)
    Button1: TButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

end.
DanielH
  • 123
  • 1
  • 10
  • 2
    Submit a bug report with an [mcve] – David Heffernan Mar 16 '16 at 22:25
  • If you're *having memory leaks with every application*, you should have no problem providing us with a MCVE that demonstrates the problem, right? – Ken White Mar 16 '16 at 23:57
  • It does look like a bug. There shouldn't be any way that you can leak a `TApplication`... at least not without really trying. – J... Mar 17 '16 at 02:36
  • You're creating stuff, but not freeing it. This is not Java, there is no garbage collection, you have to `Free` objects when you're done with them. If you create stuff in `FormCreate` you can free it in `FormDestroy`. – Johan Mar 17 '16 at 21:51
  • @Johan It would be relevant if the application was creating "stuff" and not freeing them. As I described in the steps to reproduce, the application has a single form with a button on it - that's all, no objects created. – DanielH Mar 17 '16 at 23:41
  • @DanielH, see that's why we need the code. You've reduced us all to playing a guessing game. The form code will also tell us what components are on the form. – Johan Mar 18 '16 at 13:59
  • @Johan, What's unclear by writing "a single form with a button on it"? It means that there is only one component - a button. I edited the post including the code. – DanielH Mar 18 '16 at 18:30

0 Answers0