all groups > dotnet performance > january 2006 >
You're in the

dotnet performance

group:

Paged-Pool And Non-Paged Pool Memory Leak



Paged-Pool And Non-Paged Pool Memory Leak neal.m.shah NO[at]SPAM gmail.com
1/6/2006 7:13:30 AM
dotnet performance: All,

I've written a Windows Service that polls our database server every 10
seconds or so. It's running on multiple boxes and basically checks the
database to see if that particular machine needs to perform a specific
task.

The application was written in .NET 1.1 and C#. The servers we are
running the application on are all Windows Server 2003 SP1.

Anyway, every few days or so, this application starts eating up paged
and non-paged memory until the memory is taken, and needs to be
rebooted.

I originally suspected my data access code wasn't releasing the memory
properly and recoded my application to use a using statement and
explicitly close the data connection. But I'm still receiving the
paged and non-paged memory error.

Has anybody experienced this issue before? Is this a known bug? I was
always under the assumption that all managed code had automatic garbage
collection and I wouldn't have this issue with memory leaks.

If anybody has any idea on why I'm getting this error, please let me
know. I really appreciate you taking your time to help me out.

Thanks in Advance,
Neal
Re: Paged-Pool And Non-Paged Pool Memory Leak neal.m.shah NO[at]SPAM gmail.com
1/6/2006 9:32:43 AM
I'm also using Impersonation and calling the LogonUser and closing
appropriate handles as well.

TIA,
Neal
Re: Paged-Pool And Non-Paged Pool Memory Leak neal.m.shah NO[at]SPAM gmail.com
1/6/2006 9:33:11 AM
I'm also using Impersonation and calling the LogonUser and closing
appropriate handles as well.

TIA,
Neal
Re: Paged-Pool And Non-Paged Pool Memory Leak Willy Denoyette [MVP]
1/7/2006 11:56:38 AM

[quoted text, click to view]
| All,
|
| I've written a Windows Service that polls our database server every 10
| seconds or so. It's running on multiple boxes and basically checks the
| database to see if that particular machine needs to perform a specific
| task.
|
| The application was written in .NET 1.1 and C#. The servers we are
| running the application on are all Windows Server 2003 SP1.
|
| Anyway, every few days or so, this application starts eating up paged
| and non-paged memory until the memory is taken, and needs to be
| rebooted.
|
| I originally suspected my data access code wasn't releasing the memory
| properly and recoded my application to use a using statement and
| explicitly close the data connection. But I'm still receiving the
| paged and non-paged memory error.
|
| Has anybody experienced this issue before? Is this a known bug? I was
| always under the assumption that all managed code had automatic garbage
| collection and I wouldn't have this issue with memory leaks.
|
| If anybody has any idea on why I'm getting this error, please let me
| know. I really appreciate you taking your time to help me out.
|
| Thanks in Advance,
| Neal

The GC doesn't collect unmanaged memory or unmanaged handles, that's still
your code's responsability (through Dispose).
I'm also not clear on how you get paged pool and unpaged pool statistics,
are you running a particular tool to watch your memory consumption?
Anyway you should run a memory profiler to watch your managed/unmanaged
memory consumption, the CLRprofiler is freely downloadable from :
http://www.microsoft.com/downloads/details.aspx?FamilyId=A362781C-3870-43BE-8926-862B40AA0CD0&displaylang=en
isn't that bad, others like Scitec (http://memprofiler.com/) have some more
options and have trial versions available for download.

Willy.

Re: Paged-Pool And Non-Paged Pool Memory Leak neal.m.shah NO[at]SPAM gmail.com
1/9/2006 7:01:46 AM
Hi Willy,

Our Network Administration Team has performance monitors set up on all
of our servers. In case of of a unexpected shutdown, everything gets
recorded to the event log. I'm going to continue to research on why
the paged and non-paged memory gets used up. 99% of the time the
application doesn't call the unmanaged code. That is why I'm so
stumped.

Thanks again for your help.

Neal
Re: Paged-Pool And Non-Paged Pool Memory Leak Naveen
1/9/2006 8:23:01 AM
The simplest way to get analyze the problem is to get a crash dump
using adplus.vbs which is part of windows debugging tools.

Adplus.vbs -crash -p <process id>

So you get a memory dump that can be analyzed later using SOS and
Windbg.
Re: Paged-Pool And Non-Paged Pool Memory Leak Chester
2/16/2006 1:30:27 PM


[quoted text, click to view]
Re: Paged-Pool And Non-Paged Pool Memory Leak Chester
2/16/2006 1:50:28 PM
The largest possibility is an object is created repeatedly. In some way
another in-memory object(collection) still holds a reference to this object
after it goes out of the scope.

For example:
Form f1 = new Form();
Form f2;

while(true)
{
f2 = new Form();
f2.Owner = f1;
f2 = null;
}

AddThis Social Bookmark Button