* * *

Author Topic: Heap dump by heaptrc unit on Windows  (Read 1913 times)

ricardo.consolo

  • New member
  • *
  • Posts: 16
Heap dump by heaptrc unit on Windows
« on: March 01, 2017, 01:51:11 pm »
Hi.

When in debug mode (Windows 7 32 bits), I got this message when closing the application:

---------------------------
Error
---------------------------
Heap dump by heaptrc unit
9426 memory blocks allocated : 2495279/2522280
9426 memory blocks freed     : 2495279/2522280
0 unfreed memory blocks : 0
True heap size : 294912
True free heap : 294832
Should be : 294912

---------------------------
OK   
---------------------------

The same application does not show that on Linux (Centos 6 32 bits).

Any clue?

Thanks.

howardpc

  • Hero Member
  • *****
  • Posts: 2396
Re: Heap dump by heaptrc unit on Windows
« Reply #1 on: March 01, 2017, 02:15:10 pm »
Perhaps on Linux the heaptrc output is being sent to a nonexistent or hidden window, or maybe your Linux compilation setup is not set to generate heaptrc output at all.

Ondrej Pokorny

  • Full Member
  • ***
  • Posts: 184
Re: Heap dump by heaptrc unit on Windows
« Reply #2 on: March 01, 2017, 02:57:30 pm »
Linux sends it to the standard output.

avra

  • Hero Member
  • *****
  • Posts: 1146
    • Additional info
Re: Heap dump by heaptrc unit on Windows
« Reply #3 on: March 01, 2017, 03:33:23 pm »
Have you tried to uncheck "Use Heaptrc unit" in Project options / compiler options / debugging ?
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

Thaddy

  • Hero Member
  • *****
  • Posts: 4633
Re: Heap dump by heaptrc unit on Windows
« Reply #4 on: March 01, 2017, 04:52:57 pm »
And fortunately heaptrc also reports there's not much wrong with your code?  O:-) That memory will be free'd.
If you want to use the heaptrc unit and keep it (only with -gh,not as an include in the uses clause)  there's also the option to compile with UseHeapTrace:= False.
Which skips the report.

But make sure that you did not add heaptrc to a uses clause anywhere yourself!. See the recent wiki.
http://wiki.freepascal.org/heaptrc

Avra's pointer is correct by the way: that selects or un-selects -gh for you.
« Last Edit: March 01, 2017, 05:00:45 pm by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

ricardo.consolo

  • New member
  • *
  • Posts: 16
Re: Heap dump by heaptrc unit on Windows
« Reply #5 on: March 01, 2017, 10:05:55 pm »
Thanks for the info.

I have checked them all and got it working.

FYK, Linux output happens only when running the app from the terminal.

Also, there was a bad destroy method in my code that I fixed.

Thanks.

michaelthuma

  • New member
  • *
  • Posts: 45
Re: Heap dump by heaptrc unit on Windows
« Reply #6 on: November 17, 2017, 03:52:17 pm »
View-Debug Windows - Console Output


Thanks for the info.

I have checked them all and got it working.

FYK, Linux output happens only when running the app from the terminal.

Also, there was a bad destroy method in my code that I fixed.

Thanks.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus