On 24 Mar 2007, at 12:12, Alex wrote:
> I guess its no biggie if I don't delete the windows, since they  
> usually will always be required while the application is running.  
> But for other uses, I think I definitely need to free any resources  
> that are no longer required, since if I just keep allocating and  
> allocating without ever freeing, I will run out of memory quickly.

How many widgets do you plan on allocating? The footprint of a fltk  
widget is just, like, 70 bytes or something (I can't remember the  
actual figure) so you would need to allocate an awful lot of widgets  
before it became a problem.

Or are you talking about other memory use in your program? That you  
do have to manage - fltk only looks after it's own...


> Then you will see in your performance monitor that your application  
> is hogging 500 MB of RAM doing nothing.

Hmm, reading memory usage monitors on pretty much all OS platforms is  
a black art - what it says it is using is generally what the virtual  
memory manager is showing. This is seldom (i.e. never) the amount of  
physical RAM that the app actually has mapped at any given time,  
rather it is a lot more than the app is actually using.
If you are really worried about RAM usage, you generally have to set  
about things with other tools to find out what your app really does  
have in use...

> Which in turn means no other applications can make use of this  
> memory until I close my application.

True, but see above. And bear in mind that virtual memory and paging  
means that mostly all the apps running on a system are "using" the  
same RAM all the time... or at least think they are, anyway!

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to