lkml.org 
[lkml]   [1996]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Memory intensive processes (fwd)
Date

> Yes, Linux does something LIKE this. But I beleive that the malloc..ed
> memory was allocated (all of it), but marked read-only. When a write
> to the memory occurs, the kernel makes a physical allocation and marks
> it read/write. However, I think that all of it gets allocated when
> a write occurs, at least everything up to the point at which the write
> occurred. I think that if you write a single byte at the end of your
> 20 megabyte buffer, the whole buffer then becomes "REAL" rather than a
> single page. You might check this out. Note that the ix86 makes it

OK, I just checked it out. If I write to buff[max-1] in the program,
nothing significant changes. Also one of the frequent complaints about
linux is that you can allocate far more memory than you have ram+swap.
You only get into trouble if you try to use more of it than you have
the ram+swap to cover. This leads me to believe that it did not really
allocate the memory, but is playing page table tricks like you are taling
about.


Jim

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.291 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site