Exhausting NonPagedPool

Hello everyone!

I have a driver that creates its own drives and mounts its own file system
on top of them. I’m testing drive creation/destruction using an application
(that, actually, controls this process). So, test is automated and creates /
destroys some 20-25 drives per second. There is no file open going on on my
drives, I’m simply opening a volume to cause mount to take place. What I’m
observing is that NonPagedPool usage constantly grows about 4K per second
and eventually system runs out of NonPagedPool space. I’m almost certain
that all memory allocated by my driver is properly freed. Tracking list of
devices I don’t see neither my disk device or file system device in that
list.

Anyone has an idea what is going on?

TIA,

Vladimir

Exhausting NonPagedPool>is that NonPagedPool usage constantly grows about 4K
per second and

eventually system runs out of NonPagedPool space. I’m almost certain that
all memory allocated by my driver is properly freed. Tracking list of
devices I

Try WinDbg’s !poolfind.

Max

!poolused

!poolfind doesn’t answer very many questions unless you know what you
are looking for.

Turn on pool tag tracking with gflags.exe.

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, June 20, 2000 1:41 PM
To: File Systems Developers
Subject: [ntfsd] Re: Exhausting NonPagedPool

Exhausting NonPagedPool>is that NonPagedPool usage constantly grows
about 4K
per second and

eventually system runs out of NonPagedPool space. I’m almost certain
that
all memory allocated by my driver is properly freed. Tracking list of
devices I

Try WinDbg’s !poolfind.

Max


You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Whoops, posted that to the wrong list.


Way back, last year, the following was posted. This may be
contributing to your observed leak:

-----Original Message--------------------------------------------------
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Thursday, July 29, 1999 11:15 AM
To: ‘Steve Hayward’
Cc: ‘xxxxx@atria.com’
Subject: RE: [ntdev] IoCreateDevice/IoDeleteDevice memory leak

Yes it’s a bug. It will be fixed in the post Win2K release. This memory leak
will happen only if you specify one of the following as your device type.

FILE_DEVICE_DISK
FILE_DEVICE_TAPE
FILE_DEVICE_CD_ROM
FILE_DEVICE_VIRTUAL_DISK

These values are specified only by storage devices, and at least on NT4.0,
once created these device objects are not deleted at all. Anyway thanks for
your feedback.

Eliyas

-----Original Message-----
From: Steve Hayward [mailto:xxxxx@avantis.co.uk]
Sent: Thursday, July 29, 1999 2:51 AM
To: Eliyas Yakub
Subject: RE: [ntdev] IoCreateDevice/IoDeleteDevice memory leak

Eliyas

Thanks for your response I have found now the leak.
It seems that the IoDeleteDevice does not free the the VPB block. The
following code plugs the leak.

// extract the pointer to the Vpb
pVpb = pNewDeviceObject->Vpb;

// first free the VPB if it exits
if(pVpb != NULL)
{
// set value in the device object to NULL
pNewDeviceObject->Vpb = NULL;

// now free the buffer
ExFreePool(pVpb);
}

// now delete the device
IoDeleteDevice(pNewDeviceObject);

This is also backed up by the fact that creating devices as
FILE_DEVICE_UNKNOWN does not have the same leak problem.

Steve


[ To unsubscribe, send email to xxxxx@atria.com with body
UNSUBSCRIBE (the subject is ignored). ]


You are currently subscribed to ntdev as: david_cox2@hp.com
To unsubscribe send a blank email to xxxxx@lists.osr.com