[heaptrc] no output for weblaz projects.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[heaptrc] no output for weblaz projects.

Thierry B.
Hi,

I use heaptrc unit without any problem, using Lazarus project options.

Now I try fcl-web applications (curently fphttpapp) and... heaptrc does
not work. I see the heap.trc file creation in the project directory, but
the file in simply empty.

I wonder if it is working for someone else.

--
Linux 64bits Lazarus 1.6.1 fpc 3.0.1 HEAPTRC="log=heap.trc nohalt"

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: [heaptrc] no output for weblaz projects.

Graeme Geldenhuys-6
On 2016-03-25 22:02, Thierry B. wrote:
> Now I try fcl-web applications (curently fphttpapp) and... heaptrc does
> not work.

It's because the FCL code is not heaptrc enabled. Simply add the fcl-web
source path to your project and recompile.

Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: [heaptrc] no output for weblaz projects.

Thierry B.
Le 26/03/2016 11:46, Graeme Geldenhuys a écrit :
> add the fcl-web
> source path to your project

Thanks, I tried that but it still does not work. But I discovered that's
because the program is never terminated gracefully. Stopping the
debugger after the html page is displayed (if ran from Lazarus) or using
Ctrl+C (if ran from the command line) does not fill heap.trc.

However using Application.Terminate (as explained in Lelelumbo Basic
fpWeb Tutorial) does fill heap.trc (without the need to add the fcl-web
path).

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: [heaptrc] no output for weblaz projects.

leledumbo
Administrator
> Thanks, I tried that but it still does not work. But I discovered that's
> because the program is never terminated gracefully. Stopping the
> debugger after the html page is displayed (if ran from Lazarus) or using
> Ctrl+C (if ran from the command line) does not fill heap.trc.
>
> However using Application.Terminate (as explained in Lelelumbo Basic
> fpWeb Tutorial) does fill heap.trc (without the need to add the fcl-web
> path).

Certainly. HeapTrc only does automatic writing at the end of your program, which must terminate gracefully (unit finalization section only executes that way). You can actually call DumpHeap anytime in the program flow, but that displays leaks only until that point, might be good to have an endpoint for this so you can check for leaks anytime.