Re: Memory problems (possibly very easy question)



It could be that there is some library function call that is allocating
memory that is not getting released. Also, I've seen times when the memory
is not released immediatedly to the OS until the program is actually closed.
I'm not sure how this mechanism works, but I've never seen memory not
returned after a program is closed. I've been caught by functions like
strdup() that allocate memory then expect the caller to free it when
appropriate.

I am also interested in the end of this story.

Tom

"peter koch" <peter.koch.larsen@xxxxxxxxx> wrote in message
news:1164894546.668148.143570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I see no possibility for fragmentation. Theres a loop: (1) allocate
memory (b) free memory
This will not cause any fragmentation. I agree that theres a small
amount of freeing memory for the vector (as reallocations take place),
but this will be valid for the first run of the loop.

The only logical answer is that memory does not get released. I look
forward to hear if the OP solves his problem, but I'd bet its related
to a real memory leak somewhere - not fragmentation.

/Peter



.



Relevant Pages

  • Tru64 issues with Infinite limits
    ... An automated test in my nightly build was failing due to Out of Memory ... Cannot allocate block 146 ...
    (comp.unix.tru64)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (comp.lang.cpp)
  • Re: Sharing memory between kernelspace and userspace
    ... deallocate, on a totally dynamic basis, userspace ... Let userspace allocate shared memory visible to multiple ... and pass that into the kernel for it to write to. ...
    (Linux-Kernel)
  • Re: [ckrm-tech] RFC: Memory Controller
    ... I'd pay more attention to kernel memory accounting and less ... How would you allocate memory on NUMA in advance? ...
    (Linux-Kernel)