rss resume / curriculum vitae linkedin linkedin gitlab github twitter mastodon instagram
Memory leaks
Mar 20, 2006

I still remember when programming in Java was nice and very efficient (before of C# of course), Gargabe Collector was (and still is), in that time (and before of that time) an awesome thing. However memory leaks aren't like that, I mean, not literally, because later of using the objects and setting them to be finalized takes too much time being released. I remember that same behavior in Java's GC when using JMF and the solution was the same. Nodaways while doing final performance tests in my current development, at work, and I notice this behavior. The solution is simple: System.GC.Collect(); System.GC.WaitForPendingFinalizers ();, but it needs to be used carefully, calling that two sentences everytime increases CPU usage and of course reduces application performance. The idea of using the GC every time needed (NOT EVERY TIME) (lets say every minute) stops "eating your memory".

Back to posts