Recent

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

ricardo.consolo

  • New Member
  • *
  • Posts: 17
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: 4144
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: 220
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: 2514
    • 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 - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
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 »
Specialize a type, not a var.

ricardo.consolo

  • New Member
  • *
  • Posts: 17
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: 49
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.

 

TinyPortal © 2005-2018