--Boundary-00=_iDqPC7OovieTdU4 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline KMail consumes a lot of memory when importing messages. I got 10% of the way through importing a 700Mb mbox into an mbox folder, and the kmail process had already consumed 50% of my 1Gb ram, 1Gb swap according to top. Maildir format performance was the same. Valgrind doesn't show any leaks, and having spoken with Till and looked at it would seem that the messages are created in the KMKernel::dcopAddMessage methods and are not unGot or deleted until kmail quits. The following patch[*] unGetMsg()s immediately after adding them to the folder in dcopAddMessage*. I have checked to see if calling KMFolder::addMsg() results in any persistent KMMessage *'s that will not be cleaned up by the unGetMsg() and haven't seen anything obviously dangerous, but could someone more familiar with KMail tell me if this fix is a bad idea? One side effect is that it really slows down mail import. But you don't get OOM killed. Will [*] diff against kmkernel.cpp, no cvs diff today -- Will Stephenson IRC: Bille --Boundary-00=_iDqPC7OovieTdU4 Content-Type: text/x-diff; charset="us-ascii"; name="kmail_eats_mem_importing.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmail_eats_mem_importing.diff" --- kmkernel.cpp~ 2005-03-21 10:21:50.105280584 +0000 +++ kmkernel.cpp 2005-03-21 10:06:09.023069451 +0000 @@ -703,7 +703,9 @@ if ( !msgId.isEmpty() ) { mAddMessageMsgIds.append( msgId ); } - if ( folder->addMsg( msg ) == 0 ) { + int index; + if ( folder->addMsg( msg, &index ) == 0 ) { + folder->unGetMsg( index ); retval = 1; } else { retval =- 2; @@ -756,7 +758,9 @@ KMFolder *folder = the_folderMgr->findOrCreate( foldername, false ); if ( folder ) { - if ( folder->addMsg( msg ) == 0 ) { + int index; + if ( folder->addMsg( msg, &index ) == 0 ) { + folder->unGetMsg( index ); retval = 1; } else { retval =- 2; --Boundary-00=_iDqPC7OovieTdU4 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --Boundary-00=_iDqPC7OovieTdU4--