Re: help with huge memory consumption??



Robert Redelmeier <redelm@xxxxxxxxxxxxxxx> wrote:
Rainer Weikusat <rainer.weikusat@xxxxxxxxx> wrote in part:
By definition, threads run in the same address space and each
thread as access to the memory all other threads have access
to, too (assuming it has a pointer pointing into first).

If all the memory is marked as shared (with the exception of
the stacks) this puts a lot of memory pressure on the heap.
A special thread-safe heap-only malloc() may be needed.

But precisely, modern mallocs are programmed to be thread friendly, for
example by having several arenas for allocating memory, so that several
threads can allocate concurrently without locking. I think this is the
case for Linux, Solaris and FreeBSD.


--

Michel TALON

.



Relevant Pages

  • Re: char *p = "longenough";
    ... suspicious the writer though he was allocating a memory buffer. ... as actually allocating memory and copying data, ... initialized value of statename was not particularly useful unless it was ... > which is used outside the videointerrupt to ...
    (comp.lang.c)
  • Re: having difficulty getting the unit to use an include file
    ... "constructor" function which returns the instance. ... declaring a variable of that type, or by allocating memory to a pointer ... reference to the string, ...
    (comp.lang.pascal.delphi.misc)
  • Memory Allocation
    ... I need some help in allocating memory and understanding how the system ... int iret1; ... Because of a piece of 3rd party hardware, I'm forced to run the kernel ...
    (Linux-Kernel)
  • Re: allocating 99% RAM
    ... int main ... If you keep allocating memory, eventually, ... Then try to malloc() it ... Just allocating memory, and causing memory leak, in an infinite loop is ...
    (comp.lang.c)
  • Re: How long would you quote?
    ... you are responsible for allocating memory and freeing it when ... the JVM is responsible for allocating the memory ... collector is responsible for cleaning up any unreachable references to ... lurking in other places in your app. ...
    (comp.lang.java.programmer)