[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: About memory allocation failures....
From:       Thiago Macieira <thiagom () wanadoo ! fr>
Date:       2002-01-28 17:45:42
[Download RAW message or body]

Kuba Ober wrote
>I agree. I presume the only way to handle memory allocation issues is to
> warn user when the amount of available (free mem + free swap +
> (buffers+cache - reasonable minimum)) is below a certain threshold.
> Reaching that threshold is the only condition which can cause new/memalloc
> to fail, and it's a system-wide condition. A tiny application sitting there
> and looking at the system's current memory footprint would do. A message
> box may then say thing like that:

Here we run into the same problem that was discussed for free disk space. How 
are we going to determine what's low and what's not? The same way we had an 
application dumping half a gig on the disk from one moment to the other, we 
can have an application requesting several megabytes at once. VMWare does 
that, for instance (mine allocates 96MB).

And like you have quotas on disk space, you can have a limit on the resident 
set size. So, while the whole system has hundreds of megabytes free, a 
certain given user might have no more than a few pages left.

My opinion is that dealing with low-memory situations is best left to the 
kernel. What we can do is abort with fatal errors and dump something to 
stderr or .xsession-errors. Nevertheless, I try and test for new/malloc 
returning 0 in almost every case and return with error.

-- 
  Thiago Macieira - UFOT Registry number: 1001
 thiagom@mail.com
   ICQ UIN: 1967141  PGP: 0x8F2978D5 and 0xEA9037A5 (PGP 2.x)
     Registered Linux user #65028


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic