How to handle Out-of-Memory in Konqueror?

Christian Loose christian.loose at hamburg.de
Wed Feb 25 18:31:38 GMT 2004


Am Mittwoch, 25. Februar 2004 10:44 schrieb Josef Weidendorfer:
> Hi,
>
> I need your advice. Bug [75775] (konqueror fsview part crashes when viewing
> a large directory) comes from an out of memory condition. The backtrace
> shows that the crash is an abort(), triggered by raising an out-of-memory
> exception in new().
>
> How to cope with this in a graceful way?
>
> Of course, I'm thinking about using less memory resources in fsview
> (currently around 600 Bytes per file). But if someone looks at the root
> directory of a file server, there will always be the possibility for this
> out-of-memory condition.
>
> First thing: I will have to catch the exception? Or is it enough to check
> for zero as return value from new() ?
> Next: Does it help in this case to free as many objects as possible before
> showing a notification in message box, or is the process doomed to fail
> anyway?
>
> Josef

Hi Josef,

I think you might find the following article by Herb Sutter interesting. It 
gives some hints when it makes sense to check for new failure.

http://www.gotw.ca/publications/mill16.htm

Bye
Christian




More information about the kde-core-devel mailing list