Re: help with huge memory consumption??
- From: Robert Redelmeier <redelm@xxxxxxxxxxxxxxx>
- Date: Sun, 04 Mar 2007 17:00:17 GMT
Rainer Weikusat <rainer.weikusat@xxxxxxxxx> wrote in part:
The stack is the area of memory that is constantly written to, because
it contains storage for local variables of subroutines and is used to
temporarily save register values and subroutine return addresses.
Agreed that the stack is often written, so goes CoW quickly.
It would probably be best for the kernel to copy the page
right away rather than wait for the inevitable exception.
Your idea about 'copy on write' stacks is grotesque: The stack
contains the call chain of the thread that uses it for running,
ie activation records of currently active subroutines, and the
newly created thread does not share any of this state with its
creator (and could not meaningfully share it anyhow).
Oh? I agree it doesn't need the activation records. But it does
need data. At least the call parameters! And what if one of
those params is [horrors!] a pointer to a buffer on the stack?
It's going to at least read that ptr, and in some cases write it
(in which case the mem had better be marked shared. But CoW is
still a good idea for process/thread isolation.
-- Robert
.
- Follow-Ups:
- Re: help with huge memory consumption??
- From: Rainer Weikusat
- Re: help with huge memory consumption??
- References:
- help with huge memory consumption??
- From: Dan Miller
- Re: help with huge memory consumption??
- From: Bin Chen
- Re: help with huge memory consumption??
- From: Robert Redelmeier
- Re: help with huge memory consumption??
- From: Bin Chen
- Re: help with huge memory consumption??
- From: Robert Redelmeier
- Re: help with huge memory consumption??
- From: Rainer Weikusat
- Re: help with huge memory consumption??
- From: Robert Redelmeier
- Re: help with huge memory consumption??
- From: Rainer Weikusat
- Re: help with huge memory consumption??
- From: Robert Redelmeier
- Re: help with huge memory consumption??
- From: Rainer Weikusat
- help with huge memory consumption??
- Prev by Date: Re: measured cpu time + sleep
- Next by Date: Re: help with huge memory consumption??
- Previous by thread: Re: help with huge memory consumption??
- Next by thread: Re: help with huge memory consumption??
- Index(es):
Relevant Pages
|