Re: memory allocation/deallocation problem

From: Eric Sosman (Eric.Sosman_at_sun.com)
Date: 03/17/04


Date: Wed, 17 Mar 2004 10:52:37 -0500

Ognen Duzlevski wrote:
> [reformatted for readability -- if you can't figure out how to
> get your news posting software to keep the lines to a reasonable
> length, consider pressing the ENTER or RETURN key once in a while.]
>
> I have tried to isolate the problem but this function is the
> only place where the memory is allocated and deallocated and it
> seems to be going through the deallocation loop just fine. Another
> interesting thing I just noticed is that if the memory requirements
> are smaller (smaller sequences), even the x86 version of the same
> code seems to show through top that the memory is getting allocated
> and deallocated. It is this huge 1.5 Gb chunk that for some reason
> is not getting freed (and this is not a conclusion from observing
> top but from the fact that the next time around the same function
> fails with insufficient memory).

    Have you tried the obvious experiment of reducing your program
to just the allocation and deallocation code? Plus, of course, a
little stub that calls it a few times with appropriate `tlength'
and `qlength' values.

-- 
Eric.Sosman@sun.com


Relevant Pages

  • Re: Freeing memory - will it be available immediately
    ... Your interpretation of "as the standard defines it" is ... Your interpretation of "for further allocation" as "for futher ... Except that this ignores the very reason for the standard, ... return the memory back to the OS in the manner you describe. ...
    (comp.lang.c)
  • Re: Can I Increase size of nNoMansLandSize?
    ... look at memory, I see that in the "no man's land" that the debug memory ... allocation creates, one of the DWORDs has been changed to 0x0000001. ... I can't find any rhyme or reason to when this happens, ... I can't find any other way to tap into the new/debug scheme. ...
    (microsoft.public.vc.mfc)
  • Re: HashMap with primitive int key
    ... Java and C++ differ in that Java is designed as a garbage ... and that otherwise memory allocation ... allocation, deallocation in C++ is cheap, running in constant time. ...
    (comp.lang.java.programmer)
  • Re: Need help with "Fatal Execution Engine Error"
    ... They're should be no reason why an allocation should fail. ... reason why a failure to commit memory should occur). ... TotSize PctPctUsage ...
    (microsoft.public.dotnet.framework.clr)
  • Re: OOP
    ... then compact the unused memory. ... you will also see that the memory allocation increases are much faster ... than the deallocation rate. ... reference counted memory management has a major ...
    (microsoft.public.vb.general.discussion)