Re: help with huge memory consumption??



Robert Redelmeier <redelm@xxxxxxxxxxxxxxx> writes:
Bin Chen <binary.chen@xxxxxxxxx> wrote in part:
A libc guy tell me the cause. It is stack. For default stack
size is 8MB for each thread. He said there is some method
to decrease the default stack size but I don't know how to.

`man setrlimit`

The stack size of a thread can be set during creation with the help of
an appropriately initialized thread attribute
(pthread_attr_setstacksize).

8 MB isn't unreasonable. Most of it will be shared.

A virtual page that hasn't been used yet will have no physical page
associated with it. But how can a stack page possibly be shared and
with whom?
.



Relevant Pages

  • Threads Stack Size....PRE n POST WinXP
    ... I was wondering if programatically using CreateThread() we can set (decrease the default 1MB) of the initial stack size for a thread on OS's before WinXP. ... we can however use STACK_SIZE_PARAM_IS_A_RESERVATION to decrease or increase the default reserved size but we have to live with the default commit memory. ...
    (microsoft.public.win32.programmer.kernel)
  • RE: Threads Stack Size....PRE n POST WinXP
    ... there is no way to decrease the thread stack size. ... |>the default commit memory. ... by initial size of a thread's stack we mean the reserved mem ...
    (microsoft.public.win32.programmer.kernel)
  • Re: help with huge memory consumption??
    ... to decrease the default stack size but I don't know how to. ... But it _is_ mapping 2,000 pages, each of which takes at least ... bytes in the kernel, so the kernel will need at least 8 KB ...
    (comp.os.linux.development.system)
  • Re: How to increase stack space/heap space
    ... the compiler.Can i increase it or decrease it.if yes,pleae tell me ... I'd like to see a 16K stack on an 8051... ... Jack Klein ... FAQs for ...
    (comp.lang.c)
  • Re: Write arguments on stack to stdout in Linux: How do i count the number of chars in each argume
    ... Robert Redelmeier wrote: ... >on the stack, it terminates them with a null. ... Providenza & Boekelheide, Inc. ...
    (comp.lang.asm.x86)

Loading