freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] memory leak?


From: Russell Shaw
Subject: Re: [ft] memory leak?
Date: Wed, 23 Aug 2006 11:51:08 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Debian/1.7.12-1.1

Martin Olbrich wrote:
Hello,

I am new to this list so my problem may be an old one.

After using Freetype in my program i have a bad memory leak. So i tried a sample program with just the freetype commands:

#include <ft2build.h>
#include FT_FREETYPE_H

int main( int argc, char**  argv )
{
  FT_Library library;

  FT_Face face;

//breakpoint 1
  FT_Init_FreeType(&library);

  FT_New_Face(library, "somepath/arial.ttf", 0, &face);

  FT_Done_Face(face);

  FT_Done_FreeType( library );
//breakpoint 2

  return 0;
}

At breakpoint 2 there is about 200kb more memory in use than at breakpoint 1. How can that be possible? Am I missing any commands that tidy up the freetype memory? I also tried with _just_ the FT_Init_FreeType and FT_Done_FreeType commands and get the same results.

Some more info of my system:
I checked the memory with the windows task manager and compiled Freetype 2.2.1 with MS VS2005.

Thx for any help

Maybe Windoze is reporting memory it has chosen not to release, or there was a
bug in 2.2.1? With Valgrind on freetype-cvs i get:

valgrind ./test
==8075== Memcheck, a memory error detector.
==8075== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==8075== Using LibVEX rev 1575, a library for dynamic binary translation.
==8075== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==8075== Using valgrind-3.1.1-Debian, a dynamic binary instrumentation 
framework.
==8075== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==8075==
...
==8075==
==8075== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
--8075--
--8075-- supp:   17 Debian libc6 stripped dynamic linker
==8075== malloc/free: in use at exit: 0 bytes in 0 blocks.
==8075== malloc/free: 72 allocs, 72 frees, 48,027 bytes allocated.
==8075==
==8075== All heap blocks were freed -- no leaks are possible.
--8075--  memcheck: sanity checks: 2 cheap, 1 expensive
--8075--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--8075--  memcheck: auxmaps: 0 searches, 0 comparisons
--8075--  memcheck: secondaries: 12 issued (768k, 0M)
--8075--  memcheck: secondaries: 27 accessible and distinguished (1728k, 1M)
--8075--     tt/tc: 6,191 tt lookups requiring 6,294 probes
--8075--     tt/tc: 6,191 fast-cache updates, 2 flushes
--8075-- translate: new        3,089 (70,422 -> 1,151,511; ratio 163:10) [0 scs]
--8075-- translate: dumped     0 (0 -> ??)
--8075-- translate: discarded  0 (0 -> ??)
--8075-- scheduler: 120,278 jumps (bb entries).
--8075-- scheduler: 2/3,340 major/minor sched events.
--8075--    sanity: 3 cheap, 1 expensive checks.
--8075--    exectx: 30,011 lists, 88 contexts (avg 0 per list)
--8075--    exectx: 161 searches, 73 full compares (453 per 1000)
--8075--    exectx: 0 cmp2, 38 cmp4, 0 cmpAll




reply via email to

[Prev in Thread] Current Thread [Next in Thread]