Re: [gtk-list] O.S. memory usage



Hello
> 
>     This is offtopic; my apologies.  But it's a quickie, and I don't
> know who else to ask (suggestions welcome!).
> 
>     If I write a program that does
> 
> pointer = g_malloc(LOTS_OF_RAM);
> 
>     ...and then, later on, does
> 
> g_free(pointer);
g_free(...) holds the memory in the program memory area, that means the
O.S cant handle it back to other prozesses. The memory will only get back
to the O.S while killing the application.
>     Does that memory immediately go back to the O.S.?  Will it be used
> for drive caching, other apps, etc. as my program continues to run?  Or
> does Linux (and/or other O.S.s) hold on to it, say, in case my program
> does another g_malloc or some such thing?
with g_malloc you could get back the memory which was free`d before if it
was not the app consumes more free memory from the O.S so it is always a
good thing to free unused memory after using it..
>     If anyone can suggest a good FAQ, book, or any other reference,
> I'd be very grateful.
> 
MfG
Scherf Andreas
Mail: scherfa@fh-trier.de (wwwadmin@fh-trier)
Page: http://www.fh-trier.de/~scherfa



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