View Issue Details

IDProjectCategoryView StatusLast Update
0033535FPCFCLpublic2018-07-25 21:00
ReporterAfrican Wild DogAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0.4Product Build 
Target Version3.1.1Fixed in Version3.2.0 
Summary0033535: [FCL-WEB] FCL-Web Application generates Memory Leaks
DescriptionFCL-Web application is generating memory leaks
Steps To ReproduceRun 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 InformationHeap 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
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2018-03-31 21:58

administrator   ~0107490

Presumably already fixed in trunk. Mem trace is empty.

African Wild Dog

2018-04-08 02:24

reporter   ~0107684

Please check it again. I have tested with trunk and i got this:

Heap dump by heaptrc unit
385 memory blocks allocated : 92242/93536
383 memory blocks freed : 92186/93480
2 unfreed memory blocks : 56
True heap size : 163840
True free heap : 163456
Should be : 163528
Call trace for block $00007FFFF7FE6200 size 32
Call trace for block $00007FFFF7FE5B40 size 24

African Wild Dog

2018-04-08 22:04

reporter   ~0107704

Last edited: 2018-04-08 22:04

View 2 revisions

I apologize. I ran the last test incorrectly. Please close the issue.

Michael Van Canneyt

2018-04-14 11:33

administrator   ~0107776

Closed as per OP request

Issue History

Date Modified Username Field Change
2018-03-30 02:04 African Wild Dog New Issue
2018-03-30 10:32 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-03-30 10:32 Michael Van Canneyt Status new => assigned
2018-03-31 21:58 Michael Van Canneyt Note Added: 0107490
2018-03-31 21:58 Michael Van Canneyt Status assigned => resolved
2018-03-31 21:58 Michael Van Canneyt Fixed in Version => 3.2.0
2018-03-31 21:58 Michael Van Canneyt Resolution open => unable to reproduce
2018-03-31 21:58 Michael Van Canneyt Target Version => 3.1.1
2018-04-08 02:24 African Wild Dog Note Added: 0107684
2018-04-08 02:24 African Wild Dog Status resolved => feedback
2018-04-08 02:24 African Wild Dog Resolution unable to reproduce => reopened
2018-04-08 22:04 African Wild Dog Note Added: 0107704
2018-04-08 22:04 African Wild Dog Status feedback => assigned
2018-04-08 22:04 African Wild Dog Note Edited: 0107704 View Revisions
2018-04-14 11:33 Michael Van Canneyt Note Added: 0107776
2018-04-14 11:33 Michael Van Canneyt Status assigned => resolved
2018-04-14 11:33 Michael Van Canneyt Resolution reopened => fixed
2018-07-25 21:00 African Wild Dog Status resolved => closed