Recent

Author Topic: lazarus custom CGI application memory leak.  (Read 1736 times)

BSaidus

  • Hero Member
  • *****
  • Posts: 607
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
lazarus custom CGI application memory leak.
« on: October 14, 2023, 06:19:20 am »
Hello.
Trying to learn more about CGI application on lazarus/fpc, I created an empty Custom CGI application.
Compiled project in debug mode with heaptrc activated and execute it without using a web server ( just in console).

The result is a memory leak
Code: [Select]
Heap dump by heaptrc unit of "C:\GNU\fpc331\projects\cgi\lib\i386-win32\cgiproject1.exe"
4272 memory blocks allocated : 269213/286576
4241 memory blocks freed     : 266968/284240
31 unfreed memory blocks : 2245
True heap size : 851968 (320 used in System startup)
True free heap : 845904
Should be : 846336
Call trace for block $01771408 size 16
  $00435FB2
  $0041...
  ...

The project tested on 2 lazarus/fpc flavours.
Lazarus version: 2.2.7 / FPC 3.2.3 ( Fixes ).
Lazarus version: 3.0RC1 / FPC 3.3.1 ( trunk).

Thanks.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

Warfley

  • Hero Member
  • *****
  • Posts: 1856
Re: lazarus custom CGI application memory leak.
« Reply #1 on: October 14, 2023, 08:47:39 am »
I think there once was a discussion in this forum about this, with the result being: yes it leaks, but that's no problem because the process will anyway only Hadley one request before shutting down.

BSaidus

  • Hero Member
  • *****
  • Posts: 607
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

 

TinyPortal © 2005-2018