From: Livio B. S. <li...@li...> - 2001-05-21 14:24:26
|
Hello people! After long hours of bug hunting, I've finally found bug #160 (dillo caches the same file more than once). Well, is doesn't! Actually it's a (not so small ;-) memory leak in dw_page.c (Dw_page_destroy). The patch actually is very simple. (It's impressive how *after* hunting a bug with a small patch, it seems soooo easy and obvious :-) So here's the tiny patch , which fixes a big problem: ******************** --- dillo/src/dw_page.c Mon May 21 10:35:03 2001 +++ dillo.new/src/dw_page.c Mon May 21 10:52:26 2001 @@ -277,7 +277,7 @@ static void Dw_page_destroy (GtkObject * g_free(page->lines); page->num_words = 0; /* make sure we don't own widgets anymore */ - + g_free(page->words); g_free(page->shapes); for (link_index = 0; link_index < page->num_links; link_index++) { ************************ Have I missed something? It seems that Dillo's memory usage has become a lot better now, but I fear some more leaks are still around :-( Does anyone know of a good/usable library or tool for memory profiling or memory leak detection? I've heard of libsafe from AmayaLabs, but it seems to be designed for buffer overflow detection. And I'be also heard of others like mpatrol, memprof, Electric Fence, ccmalloc, and even glib is supposed to support memory profiling, but I've never worked with any of them (and it's about time I do :-). So before I choose one, I'd like to here your opinions on these. Hopefully using one these will make make leak chasing a lot easier. I'll be glad to here any suggestions! best regards to all, -- Livio <li...@li...> |