Version: unspecified (using KDE 4.5.0)
when i open a 3,3 mb file kwrite allocs + ~19 mb. when i insert (copy & paste) ~30 mb each 3.3 mb
scrolling will enhance the effect. so for testing i opened and scrolled an 18 mb file. result: 200 mb memory allocated. if you try to open even bigger files (>30) i could allocate some gigybytes of system memory and will lead the system to crash.
problem is reproducable in kde 4.4 (opensuse 11.3 stable) and in kde 4.5.1.
also some parts of the kdelibs are a mess. and the mass of senseless new's should force the use of valgrind....
Steps to Reproduce:
system: 3gb ram
create ~18 mb file ==> load (some houndreds of mb allocated)
copy text and paste to file end ==> kwrite should hang some time whyle messing the systems ram
if file is too big kde will hang too
This is not a memory leak, but just the fact that Kate is not designed to handle such big files.
I'm pretty sure there is also another "bugreport" about this, where Christoph said that it is possible to improve the situation, but he has no urge to fix it himself (yet?).
i think the basic design of some parts of the kdelibs are the problem (kwrite/kate are using them). while working with text, there never happens a release of memory. this might be not a problem with small files, but a big when files grow bigger.
im not totally sure how the library is doing all the stuff kwrite has to handle with. but at least it should be possible to save 3,3 mb of ascii signs in 3,3 megaBYTES in memory instead alloc 20mb and at least the lib has to free memory if the user is deleting text or release a selection.
im pretty sure if this would be possible with a small fix, someone already did this. so keep in mind for future releases. qt has something like an garbage collector, but this collector cant work while the program is running.
When I tell KWrite to open the file <URL: http://ftp.mozilla.org/pub/mozilla.org/data/reporter.mozilla.org/reporter_mozilla_org_anonymized.sql.gz >, KWrite allocates up to 700MB of system memory and then the process just silently dies; no window appears.
How is this bug INVALID? KDE is unable to display files that GNU less displays like a snap! And silently crashing because of memory is unacceptable; at the very least, KWrite should be able to say "Sorry, this file is too big".