On Sun, 2006-10-22 at 15:41 +0200, Philip Van Hoof wrote:

> In the code I have found no real reason to why this was done in
> separated loops (steps) rather than one step and at the end of the loop,
> free the data already. Especially for the third step (x), which seem to
> consume most memory while it's happening.

After measuring the memory usage of the implementation, it saw that it's
not the third step but the first that is allocating 90% of the memory.
That's this loop:

        fetch_data = g_ptr_array_new ();
        messages = g_ptr_array_new ();
        while ((type = camel_imap_command_response (store, &resp, ex) ==
               CAMEL_IMAP_RESPONSE_UNTAGGED) {
                data = parse_fetch_response (imap_folder, resp);
                g_free (resp);
                ...
        }

I measured this by simply interrupting the function (returning it), and
running it in valgrind. The first one at the very start allocates
everything (while receiving the result).


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be

_______________________________________________
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers

Reply via email to