Re: help with huge memory consumption??



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

.



Relevant Pages

  • Re: Help me with redback and unibasic
    ... That problem is as old as subroutines. ... You need to keep track of the stack ... XLr8 the tool for RedBack ... need to abort from one of those subroutines and get back to ASP. ...
    (comp.databases.pick)
  • Re: No machine stack and C
    ... sensitive computing souls...whence the stack, ... Taylorism created the infamous "lines of code ... inimical to "Taylorists" because a tree structure of subroutines ...
    (comp.lang.c)
  • Re: Paper on PL/I
    ... a hardware stack for subroutine calling and returning. ... Turing and his team developed software (subroutines) for a variety of tasks ... stack machines of the Burroughs line and of the English Electric KDF9, ... recognizing his occupation, complaints about languages (Algol, FORTRAN, ...
    (comp.lang.pl1)
  • Re: Classes, Properties, and structures
    ... > also the ability to add function, subroutines, events and such that apply ... A ValueType which contains only ValueType's for fields will be created ... entirely on the stack and won't generate any garbage. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: help with huge memory consumption??
    ... for threads withing a single process be shared with whom? ... The stack is the area of memory that is constantly written to, ... it contains storage for local variables of subroutines and is used to ... private stack with an adjacent 4K guard page. ...
    (comp.os.linux.development.system)