Bug 185147 - crash - copying some 10000 mails allocates all memory
Summary: crash - copying some 10000 mails allocates all memory
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: 1.11.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 199266 219652 221998 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-21 18:18 UTC by xzill
Modified: 2015-04-12 10:13 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xzill 2009-02-21 18:18:58 UTC
Version:            (using KDE 4.1.3)
OS:                Linux
Installed from:    SuSE RPMs

kontact - kmail 4.1.0
crash - copying some 10000 mails allocates all memory, then it crashes, no bugtrack possible
Comment 1 xzill 2009-02-21 21:20:26 UTC
wrong number - KMail Version 1.10.3
Comment 2 Jaime Torres 2009-02-22 00:06:36 UTC
If you can reproduce the crash at will, may you read
http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
and post a complete backtrace here? Thanks :)

Also, you were copying the mails from (local|imap|dimap) to (local|imap|dimap)?
Comment 3 xzill 2009-02-23 11:23:13 UTC
it allocates memory and swap, it crashes only if all memory and swap is allocated, if there is no memory there is no backtrace.

copying the mails from local to imap (imap local, same computer)

reproduceable

test it and watch the memory
Comment 4 Jaime Torres 2009-02-23 22:27:03 UTC
Confirmed in kmail 1.11.0 (kde 4.2.0) "release 102" (opensuse 64-bits).
Comment 5 Mikhail S. Pobolovets 2009-04-24 14:56:24 UTC
Have the same problem with high mem usage while drag'n'dropping mails. For one mail it is about 60 mb allocated.
Comment 6 Björn Ruberg 2009-12-24 14:54:16 UTC
Just tried to copy some thousands mails to an dIMAP folder - kmail started up eating RAM
Comment 7 Björn Ruberg 2009-12-24 14:54:39 UTC
So this is still a problem in KDE 4.3.3
Comment 8 Jaime Torres 2009-12-28 13:29:08 UTC
This will not be a problem in KDE SC 4.4. I've run kmail (from trunk, revision 1066898) using valgrind, and there are no memory leaks related to copying messages.
Comment 9 Björn Ruberg 2010-03-01 23:39:01 UTC
*** Bug 219652 has been marked as a duplicate of this bug. ***
Comment 10 Björn Ruberg 2010-03-01 23:39:16 UTC
*** Bug 221998 has been marked as a duplicate of this bug. ***
Comment 11 Björn Ruberg 2010-03-01 23:39:34 UTC
*** Bug 199266 has been marked as a duplicate of this bug. ***
Comment 12 Björn Ruberg 2010-03-01 23:40:18 UTC
Found some duplicates of this. Would be nice if someone could check whether the problem still exists in KDE 4.4
Comment 13 Marcus Hardt 2010-03-02 10:55:09 UTC
I'm not sure to which extent "my" bug (#199266) is a dupe, but the described event does not occur any longer. Hence #199266 is fixed from my observations.

M.
Comment 14 kmail-bug 2010-03-02 13:33:11 UTC
sorry, bad news.
A short test confirms that this issue still exists in KDE4.4: 
I'm using the kubuntu-ppa packages at http://ppa.launchpad.net/kubuntu-ppa/ppa/ubuntu 
kmail reports v1.13.0, kontact 4.4

copying one folder of ~1000 mails of ~318MB in total from one IMAPS server to another IMAPS made memory consumption raise incredibly: 

top tells: 
beginning: VIRT=190M RES=73M
after: VIRT=2267M RES=1.4G 
memory is not freed after operation finishes.


btw: a first test with a folder with subfolders resulted in an segfault most probably because one folder name includes a dot (root/a.b) which is the folder separator on the destination imap server. This should be checked by kmail in advance IMHO. Nevertheless some mails have been copied to a sub-sub-folder (root/a/b) but not all.
Comment 15 kmail-bug 2010-03-02 13:36:08 UTC
sorry, bad news.
A short test confirms that this issue still exists in KDE4.4: 
I'm using the kubuntu-ppa packages at http://ppa.launchpad.net/kubuntu-ppa/ppa/ubuntu 
kmail reports v1.13.0, kontact 4.4

copying one folder of ~1000 mails of ~318MB in total from one IMAPS server to another IMAPS made memory consumption raise incredibly: 

top tells: 
beginning: VIRT=190M RES=73M
after: VIRT=2267M RES=1.4G 
memory is not freed after operation finishes.


btw: a first test with a folder with subfolders resulted in an segfault most probably because one folder name includes a dot (root/a.b) which is the folder separator on the destination imap server. This should be checked by kmail in advance IMHO. Nevertheless some mails have been copied to a sub-sub-folder (root/a/b) but not all.
Comment 16 Björn Ruberg 2010-03-02 13:42:55 UTC
Jaime made sure, that there is no memory leak. But probably allocated memory is freed after the whole copy process. One of the duplicates even suggested that. The result is no memory leak, but it though can kill machines if the folders are big enough.
Comment 17 kmail-bug 2010-03-02 14:04:42 UTC
@Björn: 
I don't know what "made sure" means in this context but in my test the copy operation was completed and I waited some minutes more but the memory consumption did not change. 
This might happen only if copying from one server to another but the result is quite clear to me. Maybe you or someone else could try a similar test? 

Another comment: a mail client should be be able to copy or move folders much bigger than the memory available since only the mails currently being moved have to be kept in memory. 
So IMHO even if the memory would be freed after some time this behaviour is not acceptable and would be a bug. 

I really would appreciate if you could do a similar test with two imap servers. 
I had this problem since long with kmail and therefore always use Thunderbird or Outlook to move mails to my archive-account because of this defiency.
Comment 18 Jaime Torres 2010-03-02 21:28:07 UTC
I do not remember if I copied them from one server to another or in the same server, or from one sever to local folders, sorry. But I'm actually so busy with work that I can no check it again in a near future.
Comment 19 Dan Keshet 2010-09-28 05:59:18 UTC
I experienced this issue on 1.13.2 (KDE 4.4.2) copying ~12,000 messages (425MB) from a local to imap (not disconnected).  It kept using memory until the linux out-of-memory killer killed the process, so no stack trace.  It used at least more than 1GB of memory used before it was killed.  In the end, it didn't copy any of the messages over at all, which makes me suspect that it's trying to load all messages into memory before copying any.
Comment 20 ludovic pollet 2012-02-26 14:36:27 UTC
I experience the same issue here (Version 1.13.6).
In top, the process grow up to 2G of VIRT size then crash.

It is probably not a true memory leak because copying the same files in chunck of 100 mails worked without crash.
Comment 21 Sergio Martins 2013-07-01 17:34:01 UTC
Can you try KMail2 from KDE 4.10 ?
Comment 22 Laurent Montel 2015-04-12 10:13:07 UTC
Thank you for taking the time to file a bug report.

KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.