[FCL-WEB] FCL-Web Application generates Memory Leaks
Original Reporter info from Mantis: africanwilddog
-
Reporter name: African Wild Dog
Original Reporter info from Mantis: africanwilddog
- Reporter name: African Wild Dog
Description:
FCL-Web application is generating memory leaks
Steps to reproduce:
Run the project bellow and go to the URL: http://localhost:8080/shutdown:
===== CODE =====
program memory_leak_project;
{$mode objfpc}{$H+}
uses
sysutils, fphttpapp, httproute, httpdefs;
type
{ TShutdownAction }
TShutdownAction = class(TRouteObject)
Public
Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); override;
end;
procedure TShutdownAction.HandleRequest(ARequest: TRequest; AResponse: TResponse);
begin
Application.Terminate;
end;
begin
HTTPRouter.RegisterRoute('/shutdown', TShutdownAction);
SetHeapTraceOutput('C:\heap.trc');
Application.Port:=8080;
Application.Initialize;
Application.Run;
end.
======================
Additional information:
Heap dump:
Heap dump by heaptrc unit
360 memory blocks allocated : 22230/23392
358 memory blocks freed : 22174/23336
2 unfreed memory blocks : 56
True heap size : 425984 (192 used in System startup)
True free heap : 425408
Should be : 425480
Call trace for block $00000000010FB6C0 size 32
$00000001000115D6
$000000010000A7DB
$0000000100025337
$000000010002562E
$000000010002544D
$000000010002ACBA
$000000010002B77D
$000000010002B3D9
Call trace for block $00000000010FB600 size 24
$000000010000A762
$0000000100008557
$00000001000083F6
$000000010002ACAA
$000000010002B77D
$000000010002B3D9
$00000001000380E1
$0000000100034CC1
Mantis conversion info:
- Mantis ID: 33535
- Version: 3.0.4
- Fixed in version: 3.2.0
- Target version: 3.1.1