Re: memory leak`s



Yes, the task manager is a first approximation if you know how to interpret it, but
relying on it for an instantaneous snapshot whose meaning is not interpreted sensibly is
misleading. In my essay, for example, I point out what you said. A consistent monotonic
increase is a serious indicator, although whether it represents a memory leak or
increasing memory fragmentation is not determinable just by watching the memory increase.
Looking at the behavior when the program is minimized is largely meaningless.
joe

On Sun, 20 Mar 2005 20:37:07 -0800, "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx> wrote:

>If committed virtual memory is steadily increasing, there is likely a memory
>leak. Since the lost memory may not be accessed anymore, the working set may
>stay the same, but the program may eventually run out of the virtual memory.
>
>Task Manager may show USER objects count increasing, too, if GDI resoures
>are leaked.
>
>I guess the MFC debug memory allocator may show the lost allocations at the
>program shutdown.
>
>"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
>news:3qoo31ppjlp3v3udnnfiug256mv4f9lgng@xxxxxxxxxx
>> Fascinating.
>>
>> First, it is incorrect to use 0xffffffff as a value. The documentation
>> states
>> (SIZE_T)-1
>> and that is important, because on a 64-bit processor, it will set the
>> working set size to
>> 4GB (0xffffffff is not (SIZE_T)-1 on a 64-bit processor).
>>
>> Second it is clear that your clients are idiots. It is more important for
>> them to see a
>> small size than to see acceptable performance! By doing this, you swap the
>> entire program
>> out of memory, which then means you take page faults like crazy.
>>
>> If you get an L1 cache hit, you get 0 CPU cycles delay in accessing the
>> data
>> If you get an L1 cache miss, but an L2 cache hit, you lose 1 or 2 CPU
>> cycles
>> If you get an L2 cache miss, you lose 20 CPU cycles
>> If you take a page fault, you lose 20,000,000 CPU cycles
>>
>> (Note: this data may be obsolete. You may be losing far more than
>> 20,000,000 CPU cycles
>> these days!). So at best, you are forcing a six-orders-of-magnitude
>> performance penalty on
>> your program for each page fault it has to take!
>>
>> I would spend more time on customer education.
>> joe
>>
>> On Thu, 17 Mar 2005 05:14:32 +0100, Gert
>> <onlyReplyInNewsgroups@xxxxxxxxxx> wrote:
>>
>>>Dave wrote:
>>>> Hi,
>>>> I am writing an mfc vs-6 application, when I am running my application
>>>> for a
>>>> long time I see in the task manager that the virtual memory is
>>>> increasing,
>>>> but the regular memory is the same I look in my application to find
>>>> memory
>>>> leak`s but I didn't find any even when I use third party application
>>>> they
>>>> didn't find any memory leck`s!
>>>> How can I find it and fix it???
>>>> why only the virtual memory is increasing???
>>>>
>>>> Thanks!
>>>>
>>>>
>>>
>>>Try minimizing your app while you look at task-manager. You will see the
>>>memory use drop a lot. I got some customers complaining about memory use
>>>showing on task-manager, so now my program calls
>>>SetProcessWorkingSetSize(GetCurrentProcess(), 0xffffffff, 0xffffffff);
>>>every few minutes. I guess this is what windows does when it minimizes
>>>your application.
>>>
>>>Gert
>>
>> Joseph M. Newcomer [MVP]
>> email: newcomer@xxxxxxxxxxxx
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: HP Z540 MCE2005 slows down, needs periodic reboot
    ... which processes use your CPU cycles as well as how much memory each process ... and if so you can kill that process from the Task Manager. ... > is this an MCE thing or an HP thing? ...
    (microsoft.public.windows.mediacenter)
  • Re: [OT] One for the iPhone/iTouch users
    ... type of programmer education that you tend to see a lot these days in ... If you think saving CPU cycles and memory is as important as it ... and people will still want to run more complex shit than the ...
    (uk.rec.motorcycles)
  • CPU and RAM being consumed by unstoppable process! Help needed.
    ... A process called "apole.exe" is consuming most of the CPU cycles and the ... vast majority of memory on my son's computer. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: anyone downloaded the new Firebird releases?
    ... Sea Monkey or FireFox browsers as I am concerned about increased resource ... I have maxed out the memory, so there is nothing further I can do ... Am I correct in assuming that the newer releases will be more hungry for ... I do not know whether Seamonkey1.1.1+ uses more CPU cycles than your current Mozilla but this version of SM has enhanced High memory support which may help with the resources issue. ...
    (comp.os.os2.apps)
  • Re: Is this math test too easy?
    ... > communications glitch; one of the more laughable cartoons ... it was loaded into physical memory and, ... > Or one can interpret the character string as one of the values ... A pointer to an integer? ...
    (sci.math)