[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] memory leak?
From: |
David Turner |
Subject: |
Re: [ft] memory leak? |
Date: |
Thu, 24 Aug 2006 17:12:07 +0200 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
Hello Martin,
Please note that the windows task manager is *not* a reliable way to
detect memory leaks.
Even if a program has correctly released all its memory to the heap
(with 'free'), the
corresponding memory pages will still be used by its process. This is
normal behaviour
on Windows, and probably Linux as well.
Here's another test for you: initialize and close the library in a loop,
as in:
for (n = 0; n < 100000; n++)
{
FT_Init_FreeType( &library );
Sleep(1000); // sleep 1 second
FT_Done_FreeType( library );
}
If the library really leaks on your machine, you should see the process
eating a few dozens or hundred
kilobytes per second. If not, there is no leak itself.
Hope this helps,
- David Turner
- The FreeType Project (www.freetype.org)
Martin Olbrich a écrit :
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
bye
martin.
_______________________________________________
Freetype mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype
***********************************************************************************
Information contained in this email message is confidential and may be
privileged, and is intended only for use of the individual or entity named
above. If the reader of this message is not the intended recipient, or the
employee or agent responsible to deliver it to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this communication
in error, please immediately notify the address@hidden and destroy the original
message.
***********************************************************************************