[haiku-development] Re: Out of memory errors when virtual memory disabled

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 5 Dec 2011 12:08:36 +0100 (MET)

Rimas Kudelis<rq@xxxxxx> wrote:
> Should I file this as a bug? If so, what component would it be?

I think this is likely just a reporting problem: there are many things that 
"used memory" can mean. Usually (with a swap file), you want to know the actual 
use of memory, as that's pretty much the only important measurement. If you 
don't have a swap file, though, you would rather like to know how much memory 
has been requested instead.

For example, if an application asks for 500MB, but then only uses 300MB of it, 
the system still needs to guarantee that this application can access 500MB. In 
this case, if you have only 400MB of free memory, it would run out of memory 
without a swap file, even though the application could theoretically run. There 
are two strategies how to deal with this scenario: either fail early on (as you 
cannot know how much memory an application will actually use), or fail when the 
system is really out of memory. Since the latter could happen anywhere at any 
time, it's usually not what you would want.

Also, it doesn't hurt the system at all to have a swap file: it won't be used 
if there is enough memory left. And due to the above, it actually hurts a 
system if you don't have one, as you'll then need to make sure that there is 
enough memory available for a theoretical usage.

Bye,
   Axel.


Other related posts: