dsss build, tango, GC ?

Nick Sabalausky a at a.a
Mon Jun 21 10:27:26 PDT 2010


"Ferd Burton" <fredlburton at gmail.com> wrote in message 
news:hurkuc$lc6$1 at digitalmars.com...
> == Quote from Jacob Carlborg (doob at me.com)'s article
>> On 2010-06-09 21:16, Fred Burton wrote:
>> > Hi, I have (sort of) 2 questions:
>> >
>> > Background:
>> > I was doing some coding using Phobos, and recently switched to using 
>> > Tango.
>> >
>> > 1. I'm trying to build using dsss and it says :
>> > /usr/bin/ld: cannot find -lphobos
>> > collect2: ld returned 1 exit status
>> > --- errorlevel 1
>> > Command /usr/bin/rebuild returned with code 65280, aborting.
>> > Error: Command failed, aborting.
>> You have to change your default rebuild configuration file. It's located
>> in /etc/rebuild/default on Posix systems. Change the "profile" value to
>> "dmd-posix-tango". Looking at the "dmd-posix" file, you can see, in the
>> link section, that it explicitly links to "phobos" which is not
>> necessary (at least not anymore). That's why you get the linker error.
>
> Thanks.
>
> (trying...)
>
> okay, now it gives:
>
> /usr/bin/ld: cannot find -ltango-base-dmd
> collect2: ld returned 1 exit status
> --- errorlevel 1
> Command /usr/bin/rebuild returned with code 65280, aborting.
> Error: Command failed, aborting.
>
> hmm... I have a
> /usr/lib/libtango-dmd.a
>
> editing dmd-posix-tango to go from
>    cmd=dmd -L--start-group -L-ltango-base-dmd $i -of$o
> to
>    cmd=dmd -L--start-group -L-ltango-dmd $i -of$o
> works!
>
> Now it seems to cleanly build with tango.
>
>
> It does still leak memory though ( ran for 4 minutes, 20 seconds and:
>
> ==3411== 237,749,649 bytes in 515,441 blocks are definitely lost in loss 
> record 1,024 of 1,024
> ==3411==    at 0x4024918: malloc (in 
> /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==3411==    by 0x806D11C: gc_malloc (in /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8069670: _d_arrayappendcT (in 
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8064F17: 
> _D5tango4text4Util12__T5splitTaZ5splitFAaAaZAAa15__foreachbody24MFKAaZi 
> (in
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8065013: 
> _D5tango4text4Util20__T12PatternFructTaZ12PatternFruct7opApplyMFDFKAaZiZi 
> (in
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8064EED: _D5tango4text4Util12__T5splitTaZ5splitFAaAaZAAa 
> (in /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8065B9C: 
> _D3flb3gui8wordwrap9word_wrapFAAafC3flb3gui9themebase10IStyleTextZAAa (in
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x80659BE: 
> _D3flb3gui8somewind13ACustomWindow4drawMFC3flb3gui7guibase13Idraw_contextZv 
> (in
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8063672: 
> _D3flb3gui7guibase14window_manager4drawMFC3flb3gui7guibase13Idraw_contextZv 
> (in
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x804A2C9: _D3flb3gui5glgui5GlGui3runMFZv (in 
> /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x804A33B: _Dmain (in /home/fburton/lang/d/guigl/glgui)
> ==3411==    by 0x8068133: 
> _D2rt8compiler3dmd2rt6dmain24mainUiPPaZi7runMainMFZv (in 
> /home/fburton/lang/d/guigl/glgui)
> ==3411==
>
> )

Can you see how much memory the OS is reporting that your app uses both 
right after your program starts versus after those four minutes?

Also, try importing "tango.core.Memory" and then add this in your main loop:

GC.collect(); // Run full collection cycle
GC.minimize(); // Try to release some free memory back to the OS

You won't want that in there normally, of course, but see if that changes 
your results. If it doesn't, then you may be having some false-pointer 
issues.




More information about the Digitalmars-d-learn mailing list