How can a memory leak persist even after the program that caused it has closed?

StackOverflow https://stackoverflow.com/questions/23618388

  •  21-07-2023
  •  | 
  •  

Domanda

I have a C# console program that is clearly causing a memory leak. But aside from the issue of tracking down the memory leak, the really confusing thing is that even after the program shuts down and no longer shows in the Task Manager, the memory leak does not get cleaned up.

How can this be? Maybe this gives a clue as to the nature of the leak?

Evidence: Here's Task manager, showing over 24GB in use: enter image description here

Meanwhile, my process does not appear in the Processes tab, and a quick eyeball of the amount of memory in use by other processes, combined with the size of the scrollbar shows that there is no way that those numbers will add up to 24 GB: enter image description here

È stato utile?

Soluzione

Your system uses AWE Address Windowing Extensions which allows your SQL Server to quickly manipulate physical memory. Database management systems need access to large caches of data, but since the restriction for application is 2GB then those DMS get memory from AWE.

To "fix" this you have to set max server memory to smaller value, so your SQL Server won't use all of your memory.

Altri suggerimenti

Could it be an artifact of running on a VM?

See this article:

http://blogs.msdn.com/b/saponsqlserver/archive/2013/08/31/virtualization-overcommitting-memory-and-how-to-detect-it-within-the-vm.aspx

Here's another more succinct explanation of what can happen on a VM with dynamic memory:

http://blog.luxem.org/2013/05/driver-locked-memory-on-hyper-v-guests.html

I had this issue myself, and was very confused until I found these blog posts.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top