Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-16 Thread Frank Church
On 13 December 2011 16:44, Frank Church  wrote:

> How do you get a report of unfreed objects in Lazarus?
>
> I hav read something about heaptrc and valgrind, but don't know if the
> latter works on Windows.
>
> /vfclistsGUY
> --
> Frank Church
>
>

How is the output interpreted?


> ===
> http://devblog.brahmancreations.com
>



-- 
Frank Church

===
http://devblog.brahmancreations.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-14 Thread Vincent Snijders
>>
>> In your main file, call SetHeapTraceOutput in heaptrc:
>>
>> procedure SetHeapTraceOutput(const name : string);
>>
>> This is a documented feature:
>>
>> http://www.freepascal.org/docs-html/rtl/heaptrc/setheaptraceoutput.html

The logfile can be read with the leakview ide plugin, that you can
find in the lazarus/components directory.

Vincent

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Graeme Geldenhuys
2011/12/13 Frank Church :
> I am running in both console mode and in the normal mode using forms, and
> when I exit the program a lot of text flies by.

TIP
-
I highly recommend that any body developing software use heaptrc (-gh
compiler parameter) from the start of their project if possible.
Fixing a memory leak a minute after you introduced it, is much easier
than hunting down 200+ memory leaks months down the line.

I would even go as far as to say, the -gh option should be enabled by
default in Lazarus IDE.

-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Frank Church
On 13 December 2011 19:32, Michael Van Canneyt wrote:

>
>
> On Tue, 13 Dec 2011, Frank Church wrote:
>
>
>>
>> On 13 December 2011 17:10, Marcos Douglas  wrote:
>>  2011/12/13 Frank Church 
>>  >
>>  > How do you get a report of unfreed objects in Lazarus?
>>  >
>>  > I hav read something about heaptrc and valgrind, but don't know if
>> the latter works on Windows.
>>
>> Include heaptrc unit in your program (would be the first unit) or use
>> IDE 'Project'>'Project Options'|'Compiler
>> Options'|'Linking'<**Use Heaptrc unit>.
>> After you close your program, a message will be displayed to you.
>>
>>
>>
>> Can the output be logged to a file?
>>
>
> Yes.
>
> In your main file, call SetHeapTraceOutput in heaptrc:
>
> procedure SetHeapTraceOutput(const name : string);
>
> This is a documented feature:
>
> http://www.freepascal.org/**docs-html/rtl/heaptrc/**
> setheaptraceoutput.html
>
> Michael.
>
>
>
Thanks


> --
> __**_
> Lazarus mailing list
> Lazarus@lists.lazarus.**freepascal.org
> http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus
>



-- 
Frank Church

===
http://devblog.brahmancreations.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Michael Van Canneyt



On Tue, 13 Dec 2011, Frank Church wrote:




On 13 December 2011 17:10, Marcos Douglas  wrote:
  2011/12/13 Frank Church 
  >
  > How do you get a report of unfreed objects in Lazarus?
  >
  > I hav read something about heaptrc and valgrind, but don't know if the 
latter works on Windows.

Include heaptrc unit in your program (would be the first unit) or use
IDE 'Project'>'Project Options'|'Compiler
Options'|'Linking'.
After you close your program, a message will be displayed to you.



Can the output be logged to a file?


Yes.

In your main file, call SetHeapTraceOutput in heaptrc:

procedure SetHeapTraceOutput(const name : string);

This is a documented feature:

http://www.freepascal.org/docs-html/rtl/heaptrc/setheaptraceoutput.html

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Marcos Douglas
2011/12/13 Frank Church :
>
>
> On 13 December 2011 17:10, Marcos Douglas  wrote:
>>
>> 2011/12/13 Frank Church 
>> >
>> > How do you get a report of unfreed objects in Lazarus?
>> >
>> > I hav read something about heaptrc and valgrind, but don't know if the
>> > latter works on Windows.
>>
>> Include heaptrc unit in your program (would be the first unit) or use
>> IDE 'Project'>'Project Options'|'Compiler
>> Options'|'Linking'.
>> After you close your program, a message will be displayed to you.
>
> Can the output be logged to a file?

I don't know.

> I am running in both console mode and in the normal mode using forms, and
> when I exit the program a lot of text flies by.

I think I did not understand right, but I will try to answer:
Open a new console and call your program. When the program finish the
console still there.

> I am running Lazarus 0.9.30 and I remember that in 0.9.31 a dialog is show
> when the program exits. Is that dialog present in 0.9.30 with or without the
> heap trace?

I use 0.9.31 (trunk) and never use heaptrc before .31 so, I don't know
(but is very simple, just test it!)

Marcos Douglas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Frank Church
On 13 December 2011 17:10, Marcos Douglas  wrote:

> 2011/12/13 Frank Church 
> >
> > How do you get a report of unfreed objects in Lazarus?
> >
> > I hav read something about heaptrc and valgrind, but don't know if the
> latter works on Windows.
>
> Include heaptrc unit in your program (would be the first unit) or use
> IDE 'Project'>'Project Options'|'Compiler
> Options'|'Linking'.
> After you close your program, a message will be displayed to you.
>
>

Can the output be logged to a file?

I am running in both console mode and in the normal mode using forms, and
when I exit the program a lot of text flies by.

I am running Lazarus 0.9.30 and I remember that in 0.9.31 a dialog is show
when the program exits. Is that dialog present in 0.9.30 with or without
the heap trace?

> Marcos Douglas
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Frank Church

===
http://devblog.brahmancreations.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Marcos Douglas
2011/12/13 Frank Church 
>
> How do you get a report of unfreed objects in Lazarus?
>
> I hav read something about heaptrc and valgrind, but don't know if the latter 
> works on Windows.

Include heaptrc unit in your program (would be the first unit) or use
IDE 'Project'>'Project Options'|'Compiler
Options'|'Linking'.
After you close your program, a message will be displayed to you.

Marcos Douglas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you get a report of unfreed objects in Lazarus after a program runs?

2011-12-13 Thread Bart
On 12/13/11, Frank Church  wrote:
> How do you get a report of unfreed objects in Lazarus?
>
> I hav read something about heaptrc and valgrind, but don't know if the
> latter works on Windows.
>

Compiling with heaptrace enabled (-gh) will report unfreed memory.
In Lazarus it is somewehre in porjectoptions -> linking AFAIK.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus