[SDL] TTF_RenderText functions increasing memory usage

David Olsen jolynsbass at gmail.com
Fri Nov 4 21:03:43 PST 2005


I would hazard a guess that you are simply not freeing whatever surfaces are 
being returned by the rendering functions. If all you do is keep creating 
new surfaces everytime you want text, you can eat up lots of memory quickly. 
So, if you're done with it, get rid of it.
-Dave
p.s. if this is not the case, posting a brief synopsis of your code might be 
helpful.

----- Original Message ----- 
From: "Nick Stovall" <nsto135 at aol.com>
To: <sdl at libsdl.org>
Sent: Friday, November 04, 2005 10:31 PM
Subject: [SDL] TTF_RenderText functions increasing memory usage


> Hi. I'm writing a base engine class in SDL, using the TTF and mixer 
> libraries.
> I'm just about done - there are a few bugs but overall it's ready to be 
> used.
>
> One of the bugs deals with the TTF_RenderText functions - whenever they're 
> run,
> they increase the amount of RAM that my program is using. This is a 
> problem, as
> I've sat there and watched my program go from about 8.5 megs of RAM to 
> 50MB in
> about 2 minutes. I KNOW it's these functions because if I comment them out 
> and
> run the program, the RAM usage stays at a steady 8.5MB
>
> My questions are:
>
> 1) Has anyone else had this problem, and if so, how did you fix it?
> 3) Do you have any suggestions as to what might be causing this?
>
> thanks.
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl 





More information about the SDL mailing list