Re: memory leak in gtk



Junior Polegato - GTK+ & GTKmm wrote:
Vincent Torri escreveu:
On Sat, 24 Nov 2007, Junior Polegato - GTK+ & GTKmm wrote:
Vincent Torri escreveu:
On Sat, 24 Nov 2007, Michael Lamothe wrote:
From what I've heard about memory leaking, this is not unique to the
GTK library.  If the rumours are correct, applications like `ls` are
notorious for leaking memory, safe in the knowledge that the OS will
clean up after them.
and if someone calls 'ls' iteratively in his program ?
When a process finish, the OS clean up memory. However, on some cases, the cost to freeing the memory is greater than let to the OS.
and ? You have definitely a leak there. Calling, in your program (with the exec() functions family), iteratively and infinitely a program that leaks can crash your system. 'ls' is maybe not a good example, but i'm sure you see what I mean ;)
I said "on some cases", like "ls". On this case you have described, the cost is the system crash.
Generally, programming without leaks can take more time and is also the best code solution, but sometimes leaks are okay and you'll get your program done sooner.



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