Re: virtual memory leak? in asp.net app - OutOfMemory exception

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Mike" <Mike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:FD6946AC-9D6E-4907-8055-0B70B2E2A80F@xxxxxxxxxxxxxxxx
Hello,

I have an ASP.Net app pulling a large XML stream (50 MB) and loading into an
XmlDocument object. Doing so seems to allocate several hundred MBs of
virtual memory (Seen as "virtual bytes" in perfmon). This behavior seems to
happen in the XmlDocument.Load() method.

When the XmlDocument object goes out of scope, the application releases the
"working set" after a period of time, or immediately if I call GC.Collect(),
but the allocated "virtual bytes" remain.

Loading the same XML stream again seems to re-use the allocated virtual
memory, but loading a different XML stream allocates even more virtual
memory. Eventually the application throws an OutOfMemory exception.

Why is the app not releasing the virtual memory as it reaches is memory
limits?

How can I tell the application to release the virtual memory?

Restart the process. I don't believe the Common Language Runtime ever gives memory back to Windows.


Is there something about the XmlDocument object I should know?

Any commands in WinDbg that might help me see what is in virtual memory?

Thanks,
Mike

.



Relevant Pages

  • Re: memory leak
    ... MSFT have already said that they will fix this problem, ... What is your definition of "video RAM"? ... You could try to allocate and have it throw if you're out of virtual memory. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Windows array allocation problem
    ... I'm getting an "insufficient virtual memory" error when trying to allocate an array to a size which is about 385 MB less than the amount of available virtual memory. ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... allocate an array to a size which is about 385 MB less than the amount of available virtual memory. ... In both cases a call to Windows API function GlobalMemoryStatus or GlobalMemoryStatusEx immediately before the ALLOCATE statement returns a value of available virtual memory of 2,118,221,824 bytes. ... So I'm getting an "insufficient virtual memory" failure when trying to allocate the array to a size which is 384.665 MB less than the amount of reported available virtual memory. ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... allocate an array to a size which is about 385 MB less than the amount of available virtual memory. ... In both cases a call to Windows API function GlobalMemoryStatus or GlobalMemoryStatusEx immediately before the ALLOCATE statement returns a value of available virtual memory of 2,118,221,824 bytes. ... So I'm getting an "insufficient virtual memory" failure when trying to allocate the array to a size which is 384.665 MB less than the amount of reported available virtual memory. ...
    (comp.lang.fortran)
  • Re: CSWB and JPEG files
    ... that it knows the size of the file (and the loading time ... server run out of virtual memory on my system. ... Virtual memory is the only limit I know of, ... problem image compares with anything I've displayed. ...
    (comp.os.vms)