Recent

Author Topic: How reliable is HeapTrc?  (Read 3116 times)

BrainChemistry

  • Jr. Member
  • **
  • Posts: 79
How reliable is HeapTrc?
« on: June 21, 2018, 12:01:30 am »
Hi there,

how reliable is HeapTrc in detecting memory leaks? In other words, if it doesn't show any unfree'd memory blocks, is it very likely there are no memory leaks or is it highly dependent on the program design?

[You may skip this additional information: The reason why I ask this is because of this: I have structures in memory which have to be free'd by specific free routines (from shared libraries) for these structures. Anyway, HeapTrc isn't showing unfree'd blocks if I just use Pascal's free routines.]

Thanks for clarification in advance.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How reliable is HeapTrc?
« Reply #1 on: June 21, 2018, 04:38:03 am »
how reliable is HeapTrc in detecting memory leaks? In other words, if it doesn't show any unfree'd memory blocks, is it very likely there are no memory leaks or is it highly dependent on the program design?
As long as it's a single executable program, it's very reliable. If it reports no memory leaks, it means no memory leaks. Things are different if your program communicates with shared library even if it's written in FPC as well. Each executable (including a shared library) contains whole copy of the RTL (that has memory manager), so heaptrc works per executable, not across the boundary.

BrainChemistry

  • Jr. Member
  • **
  • Posts: 79
Re: How reliable is HeapTrc?
« Reply #2 on: June 21, 2018, 08:13:13 am »
Each executable (including a shared library) contains whole copy of the RTL (that has memory manager), so heaptrc works per executable, not across the boundary.

I see, thanks.

totya

  • Hero Member
  • *****
  • Posts: 720
Re: How reliable is HeapTrc?
« Reply #3 on: June 21, 2018, 11:52:37 am »
Hi there, how reliable is HeapTrc in detecting memory leaks?

Very useful as I see.

 

TinyPortal © 2005-2018