Memory Leak in cmd.exe - Software-Testing

This is a discussion on Memory Leak in cmd.exe - Software-Testing ; Hi, This is regarding the memory leak i found during testing cmd.exe. Setup: WinCE 6.0, Visual Studio 2005. What I have done: I selected cmd.exe from the list of applications through Application verifier and performed Heap Verifier, Handle Leak Verifier, ...

+ Reply to Thread
Results 1 to 3 of 3

Memory Leak in cmd.exe

  1. Default Memory Leak in cmd.exe

    Hi,

    This is regarding the memory leak i found during testing cmd.exe.

    Setup:
    WinCE 6.0, Visual Studio 2005.

    What I have done:
    I selected cmd.exe from the list of applications through Application
    verifier and performed Heap Verifier, Handle Leak Verifier, Shell Verifier
    shims on the cmd.exe. After performing the test, I came to know through log
    file, that it has got a Memory Leak.

    Doubt:
    cmd.exe is provided by default. Nothing is added to that application, but
    still there was a memory leak. I am confused whether the cmd.exe really had
    the leak or I did something wrong? mean to say some steps are missing in the
    performing test or Only selected applications can be tested through
    application verifier?

    Please help me in this regard.

    More details:
    Please see below the log file that was created on running above test.
    =====================================================
    # LOG_BEGIN 9/10/2007 14:39:33 '\Windows\cmd' '\AppVerifier_cmd_1439.log'
    # SHIM_BEGIN _verifier_ 0
    ; Time: 328976, Perf: 0x00000003 200f4595, Freq: 0x00000000 01833118
    ; Command line: ''
    ; OS Build Number: 6.0.1937
    ; App Verifier Build Number: 6.0.1937 1937
    ; --------------------------- REMINDER ---------------------------
    ; The following entries are headers, NOT runtime errors.
    ; Please use the log viewer (avlogview.exe) to display these logs,
    ; or to convert this log to a readable form.
    ; ----------------------------------------------------------------
    # LOGENTRY shim_heap.dll 0 'Generic warning
    # DESCRIPTION BEGIN
    Generic warning
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 1 'Generic error
    # DESCRIPTION BEGIN
    Generic error
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 2 'Invalid heap
    # DESCRIPTION BEGIN
    The application used an invalid heap handle. If allowed to be passed to the
    heap, it would probably lead to a fault.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 3 'Invalid pointer
    # DESCRIPTION BEGIN
    The application passed an invalid pointer. If allowed to be passed to the
    heap, it would probably lead to a fault.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 4 'Double free
    # DESCRIPTION BEGIN
    The application is attempting to free an allocation that has already been
    freed.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 5 'Heap corruption
    # DESCRIPTION BEGIN
    The application corrupted the heap by writing outside the allocated area.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 6 'Serialization warning
    # DESCRIPTION BEGIN
    The application used the HEAP_NO_SERIALIZE flag. This flag is ignored by the
    heap.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 7 'Allocation error
    # DESCRIPTION BEGIN
    A heap allocation failed unexpectedly.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 8 'Use after free
    # DESCRIPTION BEGIN
    The application wrote to a heap allocation after it had been freed. This is
    very bad!!
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 9 'Max heap size requested
    # DESCRIPTION BEGIN
    The application requested a maximum size for a heap. This shim is padding
    allocations, so the size of the heap will be larger than the app expects.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 10 'Max heap size request ignored
    # DESCRIPTION BEGIN
    The application requested a maximum size for a heap, and that request was
    ignored. The heap will be growable.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 11 'Destroying a non-empty heap - possible memory
    leak
    # DESCRIPTION BEGIN
    The application is destroying a non-empty heap. This is only a warning; it
    could be valid. Please double-check, though.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 12 'Non-destroyed heap
    # DESCRIPTION BEGIN
    The application created a heap, and did not destroy it.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 13 'Can't destroy process heap
    # DESCRIPTION BEGIN
    The application attempted to destroy the process heap.
    # DESCRIPTION END
    # LOGENTRY shim_heap.dll 14 'Injected a heap fault
    # DESCRIPTION BEGIN
    The shim is injecting a heap fault into the application. The application
    should handle this fault gracefully.
    # DESCRIPTION END
    # LOGENTRY shim_verifier.dll 0 'Started
    # DESCRIPTION BEGIN
    The application started running. This is an informational message; no action
    is required.
    # DESCRIPTION END
    # LOGENTRY shim_verifier.dll 1 'Stopped
    # DESCRIPTION BEGIN
    The application stopped running. This is an informational message; no action
    is required.
    # DESCRIPTION END
    # LOGENTRY shim_verifier.dll 2 'Unfreed library
    # DESCRIPTION BEGIN
    The application loaded a module without freeing it before process exit.
    # DESCRIPTION END
    | shim_verifier.dll 0 | 0 shim_verifier.dll 0'cmd.exe - 2:39:42 PM
    # LOGENTRY shim_verifier.dll 15 'Mismatched Load/FreeLibrary. 1 items at
    0x000135a8
    # DESCRIPTION BEGIN
    The application did not call FreeLibrary for each LoadLibrary call
    # DESCRIPTION END
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x40fa3384:
    shim_verifier.dll!(null) + 3384h
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x000135a8:
    cmd.exe!?cmd_Initialize@@YAHXZ + 264h
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain
    + 2ch
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x00011960:
    cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x00011874:
    cmd.exe!mainWCRTStartup + 18h
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    coredll.dll!MainThreadBaseFunc + 2a0h
    | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x97ffe6cc (coredll.dll)
    | shim_verifier.dll 1 | 0 kernel.dll 800aeb7c'cmd.exe - 2:42:12 PM
    | shim_heap.dll 11 | 1 kernel.dll 800aeb7c'hHeap: 0x20020010
    # LOGENTRY shim_heap.dll 16 'Un-freed heap allocation. 1 items ( 16
    bytes) at 0x00014790
    # DESCRIPTION BEGIN
    Un-freed heap allocation
    # DESCRIPTION END
    | shim_heap.dll 16 | 1 kernel.dll 800aeb7c'Callstack:
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x40f88310:
    shim_heap.dll!(null) + 8310h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    shim_heap.dll!(null) + b378h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00014790:
    cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00015f10:
    cmd.exe!?cmdutil_GetFMem@@YAPAXH@Z + 28h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00013528:
    cmd.exe!?cmd_Initialize@@YAHXZ + 1e4h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain + 2ch
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00011960:
    cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00011874:
    cmd.exe!mainWCRTStartup + 18h
    | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    coredll.dll!MainThreadBaseFunc + 2a0h
    | shim_heap.dll 16 | 1 kernel.dll 800aeb7c'Un-freed items:
    | shim_heap.dll 16 | 1 kernel.dll 800aeb7c' 0x200237d0 16 bytes,
    process: 0x0398000e, thread: 0x0399000e, PerfCount: 796988235
    | shim_heap.dll 16 | 1 kernel.dll 800aeb7c' Total: 16 bytes
    # LOGENTRY shim_heap.dll 17 'Un-freed heap allocation. 1 items ( 1028
    bytes) at 0x00014790
    # DESCRIPTION BEGIN
    Un-freed heap allocation
    # DESCRIPTION END
    | shim_heap.dll 17 | 1 kernel.dll 800aeb7c'Callstack:
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x40f88310:
    shim_heap.dll!(null) + 8310h
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    shim_heap.dll!(null) + b378h
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00014790:
    cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x000133f0:
    cmd.exe!?cmd_Initialize@@YAHXZ + ach
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain + 2ch
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00011960:
    cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00011874:
    cmd.exe!mainWCRTStartup + 18h
    | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    coredll.dll!MainThreadBaseFunc + 2a0h
    | shim_heap.dll 17 | 1 kernel.dll 800aeb7c'Un-freed items:
    | shim_heap.dll 17 | 1 kernel.dll 800aeb7c' 0x20022f50 1028 bytes,
    process: 0x0398000e, thread: 0x0399000e, PerfCount: 796431843
    | shim_heap.dll 17 | 1 kernel.dll 800aeb7c' Total: 1028 bytes
    # LOGENTRY shim_heap.dll 18 'Un-freed heap allocation. 1 items ( 512
    bytes) at 0x00014790
    # DESCRIPTION BEGIN
    Un-freed heap allocation
    # DESCRIPTION END
    | shim_heap.dll 18 | 1 kernel.dll 800aeb7c'Callstack:
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x40f88310:
    shim_heap.dll!(null) + 8310h
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    shim_heap.dll!(null) + b378h
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00014790:
    cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00013508:
    cmd.exe!?cmd_Initialize@@YAHXZ + 1c4h
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain + 2ch
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00011960:
    cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00011874:
    cmd.exe!mainWCRTStartup + 18h
    | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    coredll.dll!MainThreadBaseFunc + 2a0h
    | shim_heap.dll 18 | 1 kernel.dll 800aeb7c'Un-freed items:
    | shim_heap.dll 18 | 1 kernel.dll 800aeb7c' 0x200235b0 512 bytes,
    process: 0x0398000e, thread: 0x0399000e, PerfCount: 796798063
    | shim_heap.dll 18 | 1 kernel.dll 800aeb7c' Total: 512 bytes
    # LOGENTRY shim_heap.dll 19 'Un-freed heap allocation. 1 items ( 136
    bytes) at 0x00014790
    # DESCRIPTION BEGIN
    Un-freed heap allocation
    # DESCRIPTION END
    | shim_heap.dll 19 | 1 kernel.dll 800aeb7c'Callstack:
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x40f88310:
    shim_heap.dll!(null) + 8310h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    shim_heap.dll!(null) + b378h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00014790:
    cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00016074:
    cmd.exe!?cmdutil_FMemAlloc@@YAPAXPAX@Z + 11ch
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x000162e0:
    cmd.exe!?cmdutil_NewPointerListItem@@YAPAUPointerList@@PAXPAU1@@Z + 20h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00016480:
    cmd.exe!?cmdutil_ParseCommandParameters@@YAHAAPAUPointerList@@0PAG@Z + 88h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x0001d9ac:
    cmd.exe!?cmdexec_CmdDir@@YAHPAG0@Z + 7ch
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x000218cc:
    cmd.exe!?cmdexec_Dispatch@@YAHXZ + 480h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00021ca0:
    cmd.exe!?cmdexec_Execute@@YAHXZ + 80h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x000130bc:
    cmd.exe!?cmd_InputLoop@@YAXXZ + 38h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x0001330c: cmd.exe!wmain + f0h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00011960:
    cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00011874:
    cmd.exe!mainWCRTStartup + 18h
    | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    coredll.dll!MainThreadBaseFunc + 2a0h
    | shim_heap.dll 19 | 1 kernel.dll 800aeb7c'Un-freed items:
    | shim_heap.dll 19 | 1 kernel.dll 800aeb7c' 0x20025850 136 bytes,
    process: 0x0398000e, thread: 0x0399000e, PerfCount: 2922290324
    | shim_heap.dll 19 | 1 kernel.dll 800aeb7c' Total: 136 bytes
    # LOGENTRY shim_heap.dll 20 'Un-freed heap allocation. 1 items ( 512
    bytes) at 0x00014790
    # DESCRIPTION BEGIN
    Un-freed heap allocation
    # DESCRIPTION END
    | shim_heap.dll 20 | 1 kernel.dll 800aeb7c'Callstack:
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x40f88310:
    shim_heap.dll!(null) + 8310h
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    shim_heap.dll!(null) + b378h
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00014790:
    cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x000134c0:
    cmd.exe!?cmd_Initialize@@YAHXZ + 17ch
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain + 2ch
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00011960:
    cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00011874:
    cmd.exe!mainWCRTStartup + 18h
    | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    coredll.dll!MainThreadBaseFunc + 2a0h
    | shim_heap.dll 20 | 1 kernel.dll 800aeb7c'Un-freed items:
    | shim_heap.dll 20 | 1 kernel.dll 800aeb7c' 0x20023390 512 bytes,
    process: 0x0398000e, thread: 0x0399000e, PerfCount: 796644117
    | shim_heap.dll 20 | 1 kernel.dll 800aeb7c' Total: 512 bytes
    =====================================================


    --
    Rama Krishna. Duddu,
    Infosys Technologies Limited,
    Hyderabad,
    India.

  2. Default Re: Memory Leak in cmd.exe

    I took a quick look at the code for cmd.exe, and it appears that there are
    some heap allocations that it doesn't free up before the process exits. I'll
    forward this on to the owners of that code.

    Thanks,
    --Marty Larson [MS]

    "Rama Krishna Duddu" <RamaKrishnaDuddu@discussions.microsoft.com> wrote in
    message news:A774A2DD-F4C2-4279-8C16-50649C4042D6@microsoft.com...
    > Hi,
    >
    > This is regarding the memory leak i found during testing cmd.exe.
    >
    > Setup:
    > WinCE 6.0, Visual Studio 2005.
    >
    > What I have done:
    > I selected cmd.exe from the list of applications through Application
    > verifier and performed Heap Verifier, Handle Leak Verifier, Shell Verifier
    > shims on the cmd.exe. After performing the test, I came to know through
    > log
    > file, that it has got a Memory Leak.
    >
    > Doubt:
    > cmd.exe is provided by default. Nothing is added to that application, but
    > still there was a memory leak. I am confused whether the cmd.exe really
    > had
    > the leak or I did something wrong? mean to say some steps are missing in
    > the
    > performing test or Only selected applications can be tested through
    > application verifier?
    >
    > Please help me in this regard.
    >
    > More details:
    > Please see below the log file that was created on running above test.
    > =====================================================
    > # LOG_BEGIN 9/10/2007 14:39:33 '\Windows\cmd' '\AppVerifier_cmd_1439.log'
    > # SHIM_BEGIN _verifier_ 0
    > ; Time: 328976, Perf: 0x00000003 200f4595, Freq: 0x00000000 01833118
    > ; Command line: ''
    > ; OS Build Number: 6.0.1937
    > ; App Verifier Build Number: 6.0.1937 1937
    > ; --------------------------- REMINDER ---------------------------
    > ; The following entries are headers, NOT runtime errors.
    > ; Please use the log viewer (avlogview.exe) to display these logs,
    > ; or to convert this log to a readable form.
    > ; ----------------------------------------------------------------
    > # LOGENTRY shim_heap.dll 0 'Generic warning
    > # DESCRIPTION BEGIN
    > Generic warning
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 1 'Generic error
    > # DESCRIPTION BEGIN
    > Generic error
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 2 'Invalid heap
    > # DESCRIPTION BEGIN
    > The application used an invalid heap handle. If allowed to be passed to
    > the
    > heap, it would probably lead to a fault.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 3 'Invalid pointer
    > # DESCRIPTION BEGIN
    > The application passed an invalid pointer. If allowed to be passed to the
    > heap, it would probably lead to a fault.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 4 'Double free
    > # DESCRIPTION BEGIN
    > The application is attempting to free an allocation that has already been
    > freed.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 5 'Heap corruption
    > # DESCRIPTION BEGIN
    > The application corrupted the heap by writing outside the allocated area.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 6 'Serialization warning
    > # DESCRIPTION BEGIN
    > The application used the HEAP_NO_SERIALIZE flag. This flag is ignored by
    > the
    > heap.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 7 'Allocation error
    > # DESCRIPTION BEGIN
    > A heap allocation failed unexpectedly.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 8 'Use after free
    > # DESCRIPTION BEGIN
    > The application wrote to a heap allocation after it had been freed. This
    > is
    > very bad!!
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 9 'Max heap size requested
    > # DESCRIPTION BEGIN
    > The application requested a maximum size for a heap. This shim is padding
    > allocations, so the size of the heap will be larger than the app expects.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 10 'Max heap size request ignored
    > # DESCRIPTION BEGIN
    > The application requested a maximum size for a heap, and that request was
    > ignored. The heap will be growable.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 11 'Destroying a non-empty heap - possible memory
    > leak
    > # DESCRIPTION BEGIN
    > The application is destroying a non-empty heap. This is only a warning; it
    > could be valid. Please double-check, though.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 12 'Non-destroyed heap
    > # DESCRIPTION BEGIN
    > The application created a heap, and did not destroy it.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 13 'Can't destroy process heap
    > # DESCRIPTION BEGIN
    > The application attempted to destroy the process heap.
    > # DESCRIPTION END
    > # LOGENTRY shim_heap.dll 14 'Injected a heap fault
    > # DESCRIPTION BEGIN
    > The shim is injecting a heap fault into the application. The application
    > should handle this fault gracefully.
    > # DESCRIPTION END
    > # LOGENTRY shim_verifier.dll 0 'Started
    > # DESCRIPTION BEGIN
    > The application started running. This is an informational message; no
    > action
    > is required.
    > # DESCRIPTION END
    > # LOGENTRY shim_verifier.dll 1 'Stopped
    > # DESCRIPTION BEGIN
    > The application stopped running. This is an informational message; no
    > action
    > is required.
    > # DESCRIPTION END
    > # LOGENTRY shim_verifier.dll 2 'Unfreed library
    > # DESCRIPTION BEGIN
    > The application loaded a module without freeing it before process exit.
    > # DESCRIPTION END
    > | shim_verifier.dll 0 | 0 shim_verifier.dll 0'cmd.exe - 2:39:42 PM
    > # LOGENTRY shim_verifier.dll 15 'Mismatched Load/FreeLibrary. 1 items
    > at
    > 0x000135a8
    > # DESCRIPTION BEGIN
    > The application did not call FreeLibrary for each LoadLibrary call
    > # DESCRIPTION END
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x40fa3384:
    > shim_verifier.dll!(null) + 3384h
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x000135a8:
    > cmd.exe!?cmd_Initialize@@YAHXZ + 264h
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x00013248:
    > cmd.exe!wmain
    > + 2ch
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x00011960:
    > cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x00011874:
    > cmd.exe!mainWCRTStartup + 18h
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    > coredll.dll!MainThreadBaseFunc + 2a0h
    > | shim_verifier.dll 15 | 0 kernel.dll 800aeb7c' 0x97ffe6cc
    > (coredll.dll)
    > | shim_verifier.dll 1 | 0 kernel.dll 800aeb7c'cmd.exe - 2:42:12 PM
    > | shim_heap.dll 11 | 1 kernel.dll 800aeb7c'hHeap: 0x20020010
    > # LOGENTRY shim_heap.dll 16 'Un-freed heap allocation. 1 items ( 16
    > bytes) at 0x00014790
    > # DESCRIPTION BEGIN
    > Un-freed heap allocation
    > # DESCRIPTION END
    > | shim_heap.dll 16 | 1 kernel.dll 800aeb7c'Callstack:
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x40f88310:
    > shim_heap.dll!(null) + 8310h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    > shim_heap.dll!(null) + b378h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00014790:
    > cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00015f10:
    > cmd.exe!?cmdutil_GetFMem@@YAPAXH@Z + 28h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00013528:
    > cmd.exe!?cmd_Initialize@@YAHXZ + 1e4h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain +
    > 2ch
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00011960:
    > cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x00011874:
    > cmd.exe!mainWCRTStartup + 18h
    > | shim_heap.dll 16 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    > coredll.dll!MainThreadBaseFunc + 2a0h
    > | shim_heap.dll 16 | 1 kernel.dll 800aeb7c'Un-freed items:
    > | shim_heap.dll 16 | 1 kernel.dll 800aeb7c' 0x200237d0 16 bytes,
    > process: 0x0398000e, thread: 0x0399000e, PerfCount: 796988235
    > | shim_heap.dll 16 | 1 kernel.dll 800aeb7c' Total: 16 bytes
    > # LOGENTRY shim_heap.dll 17 'Un-freed heap allocation. 1 items ( 1028
    > bytes) at 0x00014790
    > # DESCRIPTION BEGIN
    > Un-freed heap allocation
    > # DESCRIPTION END
    > | shim_heap.dll 17 | 1 kernel.dll 800aeb7c'Callstack:
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x40f88310:
    > shim_heap.dll!(null) + 8310h
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    > shim_heap.dll!(null) + b378h
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00014790:
    > cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x000133f0:
    > cmd.exe!?cmd_Initialize@@YAHXZ + ach
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain +
    > 2ch
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00011960:
    > cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x00011874:
    > cmd.exe!mainWCRTStartup + 18h
    > | shim_heap.dll 17 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    > coredll.dll!MainThreadBaseFunc + 2a0h
    > | shim_heap.dll 17 | 1 kernel.dll 800aeb7c'Un-freed items:
    > | shim_heap.dll 17 | 1 kernel.dll 800aeb7c' 0x20022f50 1028 bytes,
    > process: 0x0398000e, thread: 0x0399000e, PerfCount: 796431843
    > | shim_heap.dll 17 | 1 kernel.dll 800aeb7c' Total: 1028 bytes
    > # LOGENTRY shim_heap.dll 18 'Un-freed heap allocation. 1 items ( 512
    > bytes) at 0x00014790
    > # DESCRIPTION BEGIN
    > Un-freed heap allocation
    > # DESCRIPTION END
    > | shim_heap.dll 18 | 1 kernel.dll 800aeb7c'Callstack:
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x40f88310:
    > shim_heap.dll!(null) + 8310h
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    > shim_heap.dll!(null) + b378h
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00014790:
    > cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00013508:
    > cmd.exe!?cmd_Initialize@@YAHXZ + 1c4h
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain +
    > 2ch
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00011960:
    > cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x00011874:
    > cmd.exe!mainWCRTStartup + 18h
    > | shim_heap.dll 18 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    > coredll.dll!MainThreadBaseFunc + 2a0h
    > | shim_heap.dll 18 | 1 kernel.dll 800aeb7c'Un-freed items:
    > | shim_heap.dll 18 | 1 kernel.dll 800aeb7c' 0x200235b0 512 bytes,
    > process: 0x0398000e, thread: 0x0399000e, PerfCount: 796798063
    > | shim_heap.dll 18 | 1 kernel.dll 800aeb7c' Total: 512 bytes
    > # LOGENTRY shim_heap.dll 19 'Un-freed heap allocation. 1 items ( 136
    > bytes) at 0x00014790
    > # DESCRIPTION BEGIN
    > Un-freed heap allocation
    > # DESCRIPTION END
    > | shim_heap.dll 19 | 1 kernel.dll 800aeb7c'Callstack:
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x40f88310:
    > shim_heap.dll!(null) + 8310h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    > shim_heap.dll!(null) + b378h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00014790:
    > cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00016074:
    > cmd.exe!?cmdutil_FMemAlloc@@YAPAXPAX@Z + 11ch
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x000162e0:
    > cmd.exe!?cmdutil_NewPointerListItem@@YAPAUPointerList@@PAXPAU1@@Z + 20h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00016480:
    > cmd.exe!?cmdutil_ParseCommandParameters@@YAHAAPAUPointerList@@0PAG@Z + 88h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x0001d9ac:
    > cmd.exe!?cmdexec_CmdDir@@YAHPAG0@Z + 7ch
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x000218cc:
    > cmd.exe!?cmdexec_Dispatch@@YAHXZ + 480h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00021ca0:
    > cmd.exe!?cmdexec_Execute@@YAHXZ + 80h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x000130bc:
    > cmd.exe!?cmd_InputLoop@@YAXXZ + 38h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x0001330c: cmd.exe!wmain +
    > f0h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00011960:
    > cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x00011874:
    > cmd.exe!mainWCRTStartup + 18h
    > | shim_heap.dll 19 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    > coredll.dll!MainThreadBaseFunc + 2a0h
    > | shim_heap.dll 19 | 1 kernel.dll 800aeb7c'Un-freed items:
    > | shim_heap.dll 19 | 1 kernel.dll 800aeb7c' 0x20025850 136 bytes,
    > process: 0x0398000e, thread: 0x0399000e, PerfCount: 2922290324
    > | shim_heap.dll 19 | 1 kernel.dll 800aeb7c' Total: 136 bytes
    > # LOGENTRY shim_heap.dll 20 'Un-freed heap allocation. 1 items ( 512
    > bytes) at 0x00014790
    > # DESCRIPTION BEGIN
    > Un-freed heap allocation
    > # DESCRIPTION END
    > | shim_heap.dll 20 | 1 kernel.dll 800aeb7c'Callstack:
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x40f88310:
    > shim_heap.dll!(null) + 8310h
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x40f8b378:
    > shim_heap.dll!(null) + b378h
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00014790:
    > cmd.exe!?cmdutil_Alloc@@YAPAXH@Z + 50h
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x000134c0:
    > cmd.exe!?cmd_Initialize@@YAHXZ + 17ch
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00013248: cmd.exe!wmain +
    > 2ch
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00011960:
    > cmd.exe!?mainCRTStartupHelper@@YAXPAUHINSTANCE__@@PBG@Z + d8h
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x00011874:
    > cmd.exe!mainWCRTStartup + 18h
    > | shim_heap.dll 20 | 0 kernel.dll 800aeb7c' 0x40071d3c:
    > coredll.dll!MainThreadBaseFunc + 2a0h
    > | shim_heap.dll 20 | 1 kernel.dll 800aeb7c'Un-freed items:
    > | shim_heap.dll 20 | 1 kernel.dll 800aeb7c' 0x20023390 512 bytes,
    > process: 0x0398000e, thread: 0x0399000e, PerfCount: 796644117
    > | shim_heap.dll 20 | 1 kernel.dll 800aeb7c' Total: 512 bytes
    > =====================================================
    >
    >
    > --
    > Rama Krishna. Duddu,
    > Infosys Technologies Limited,
    > Hyderabad,
    > India.




  3. Default Re: Memory Leak in cmd.exe

    In a .net windows application the form might have resource leaks though it is running with managed codes. We can use the below procedure to check if a form is having resource leak.
    Open Windows Task Manager
    Click on Process tab.
    Select "View" in the menu and then select "Select Columns" menu item.
    Check the USER Objects and GDI Objects (check boxes) to make them appear on the process page list header.
    The code in your project that lunches the Win Form, please ensure you have called the Dispose method. Forms implement the IDisposable interface so their dispose method must be called the moment they are no longer needed (Test 1). We can call Dispose explicitly or even better to instantiate it implicitly by the help of using clause (Test 2).
    We can use the GC.Collect() after the using statement or after the call to dispose for troubleshooting purpose.
    Now time to launch the form. Please note the note the USER Objects and GDI Objects values at the task manager. Close the form after some time and when the form is closed, note the values again at the task manager. We can find the value is decreased if it is increased then there is a leak in the form.
    Fix the resource leak and remove the call to GC.Collect(). It is generally unnecessary to make an explicit call to GC.Collect() .
    Cheers,
    Eliza

+ Reply to Thread

Similar Threads

  1. TDM memory leak LV 8.5
    By Application Development in forum labview
    Replies: 1
    Last Post: 10-31-2007, 02:10 AM
  2. Will it leak the memory?
    By Application Development in forum C
    Replies: 17
    Last Post: 07-25-2007, 03:52 PM
  3. Re: Flash OCX Memory Leak, Or .Net Framework Memory Leak
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 03-23-2006, 05:13 PM
  4. Will this cause a memory leak?
    By Application Development in forum DOTNET
    Replies: 2
    Last Post: 07-18-2005, 09:35 PM
  5. What is Memory Leak?
    By Application Development in forum basic.visual
    Replies: 0
    Last Post: 05-24-2005, 12:24 PM