How to handle Out-of-Memory in Konqueror?

Tim Jansen tim at tjansen.de
Wed Feb 25 18:48:44 GMT 2004


On Wednesday 25 February 2004 18:51, Guillaume Laurent wrote:
> *BUT*, since Qt and KDE are almost always compiled without exception
> support, you can't do the correct thing and you'd have to do the silly
> thing.

Not only because of the lack of exception support. When you got an 
out-of-memory exception and you did not get it while allocating an extremely 
large block, it's likely that whatever you do, you will get another one. 
Almost all non-trivial code allocates memory, you only need to create a 
string...
An OOM handler is extremely hard to write and test, especially when libraries 
don't document which functions can allocate memory. And even if you managed 
to do it correctly, there's no guarantee that the kernel's OOM killer will 
not kill your process without any warning.

bye...








More information about the kde-core-devel mailing list