Bug 458980

Summary: Large mbox eats the whole memory
Product: [Frameworks and Libraries] Akonadi Reporter: tusooa <tusooa>
Component: MBox ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description tusooa 2022-09-10 22:20:55 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
A large (351M) mbox will make akonadi eats all system memory.

STEPS TO REPRODUCE
1. Get a large mbox file. (I got it from gmail export)
2. Add it as a receiving account in KMail. (Configure -> Accounts -> Receiving -> Add... -> Custom account -> mbox)
3. Reboot

OBSERVED RESULT
Memory usage is very high, using almost all memory (I have 16 GB), system becomes very laggy. After `akonadictl stop`, the memory usage goes down immediately.

EXPECTED RESULT
It should not use up a lot of memory. For a comparison, mutt uses only 39M of memory opening the mbox.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:  5.18.12-gentoo-x86_64
(available in About System)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION