Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-11

Heaptrc unit is awesome

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I had a suspicion that fpGUI was leaking some memory. After activating Heaptrc I got a bit of a shocker. I needed to log the output to file because it was *very* long. [Yeah I know, nothing to be proud of].

I had 522 memory leaks!! [hiding in shame] But after enabling Heaptrc and 1 hour later, fpGUI is now totally memory leak free! :-)

And the best of all - all these cool tools are included with FPC. Great job guys!

Feature Request:

A minor Feature Request for Heaptrc. Using the log=<filename> in the environment variable works wonders. I fortunately didn't know that it doesn't clear the file on every run (I'm used to tiOPF log behaviour). So for the first 30 minutes I was constantly staring at the 522 memory leak count (first few lines of the log file) and couldn't figure out why I ain't getting that value any lower! After 30 minutes I was growing frustrated and by pure luck I looked at the log file size between runs and noticed it was growing. Heaptrc keeps _appending_ to the log and I was staring at the result of my first run (over and over). :-)

A quick: $ rm ./out.log; ./test
fixed the issue. Removing the log before each run. Damn, I wasted a lot of time on that.

Could we add extra option in the environment variable setting that clears the log file on each run?

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
I had 522 memory leaks!! [hiding in shame] But after enabling Heaptrc and 1 hour later, fpGUI is now totally memory leak free! :-)

I forgot to mention. In my defense...<wink>... 512 of those leaks were from a pre-built linked-list queue that I didn't free. I don't program that bad!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/