How to handle Out-of-Memory in Konqueror?

Thiago Macieira thiago.macieira at kdemail.net
Wed Feb 25 23:46:19 GMT 2004


Guillaume Laurent wrote:
>Yes, absolutely. Although there are different cases, where for
> instance an allocation will fail on a large block but could
> conceivably succeed on smaller ones. In any case, the only reasonable
> course of action is to exit gracefully (which wasn't too clear in the
> 1st pseudo-code sample I gave).

Gracefully would imply saving unsaved data, which might require user 
interaction. In an OOM condition, it'll be hardly possible to do that, 
unless the application willfully deallocates large chunks of memory. 

How to ensure that? The first thing that comes to mind is stack 
unwinding through an exception.

Aside from that, we end up with the option of _exiting or aborting the 
application. The first would make the window simply disappear, without 
feedback, while the second would bring Dr. Konqi up for a backtrace. A 
third option I could propose is to exec() a simple dialog box saying 
"Out of memory". (why exec? Because it would cause this application to 
quit and release its resources, freeing up memory).

-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiago (AT) macieira (DOT) info
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040225/0b37592e/attachment.sig>


More information about the kde-core-devel mailing list