Re: Qurey on physical memory allocation with malloc/calloc



In article <CZudnbX-RceU367VnZ2dnUVZ_u2dnZ2d@xxxxxxxxxxxxxxxxxxxxxx>,
Gordon Burditt wrote:

Not necessarily. What you describe is so-called "overcommitment"

It's not overcommitment if I request 1MB from malloc(), and malloc()
allocates 1MB of virtual memory in the form of 1MB of page/swap
space and no physical RAM. (If you're going to call swap space
"physical memory", point conceeded, but usually the term "physical
memory" refers to RAM directly accessible by the CPU.)

RAM => core
CPU memory => registers

.



Relevant Pages

  • Re: panic: kmem_malloc(16384): kmem_map too small: md-mounted /tmp filled up
    ... Keep in mind that changing the default can break existing setups. ... it will break systems with tons of RAM but little ... at low memory conditions". ... But malloc can only allocate from RAM, ...
    (freebsd-stable)
  • Re: Can Anyone Explain This Memory Leak?
    ... and if I remove the guard the ram doesn't do this. ... when the threads can be created and die quickly the maximum memory used by ... puts "after malloc" ... using the brk() or sbrksystem calls. ...
    (comp.lang.ruby)
  • RE: tmpfs and the OOM killer
    ... Is this because when overcommit_memory=2, ... OOM killer, now random malloc's will start returning NULL because ... When malloc return NULL, the process may tell the user ENOMEM. ... gigs of RAM when they only use a few tens of megs. ...
    (Linux-Kernel)
  • Thank You -- Thomas J. Gritzan
    ... Thomas -- Your suggestion to malloc() out a block of memory was the ... Below are some details of my memory issues ... ... As a work around solution I guessed a ram disk would solve the ... persistence will frustrate the off topic police and give them a target ...
    (comp.lang.c)
  • Re: Simple question about headers and malloc!
    ... Therefore I am making all of its declarations ... memory (using malloc) and then exit back to main. ... allocation, I get data strored from the second allocation... ...
    (microsoft.public.vc.language)