#1 2025-01-27 09:57:40

antispam88
Member
Registered: 2016-08-19
Posts: 18

Finding code positions of memory leaks using fpcx64mm

Hi,
I wan't to use the fpcx64mm memory manager to find memory leaks, but I only get classes and addresses of leaks like
probable TMemoryStream leak (40/48 bytes) at $00000000051834D0.

How can I get the code file and position of such an address?

Best regards,
antispam88

Offline

#2 2025-01-27 13:24:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,845
Website

Re: Finding code positions of memory leaks using fpcx64mm

It is not possible, because it would require to retrieve the call stack for each Getmem() which slows down everything.

Use the FPC heaptrc unit instead.

Offline

#3 2025-01-27 15:19:39

antispam88
Member
Registered: 2016-08-19
Posts: 18

Re: Finding code positions of memory leaks using fpcx64mm

Thank you for your reply!
I switched to fpcx64mm because I'm getting a EAccessViolation with enabled heaptrc.
So there is no way to identify the memory leak with fpcx64mm? Not even in debug mode?
I hope for this possibility in the future.

Best regards,
antispam88

Offline

#4 2025-01-27 19:13:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,845
Website

Re: Finding code positions of memory leaks using fpcx64mm

Sadly, it is out of scope for the moment.

If you have an EAccessViolation with heaptrc, this is not a heaptrc bug, this is more likely to be a bug in your code.
I strongly advise you to try to debug this access violation with heaptrc first.

Offline

Board footer

Powered by FluxBB