Physical memory usage

Hello all,
On an IA 64 box with Windows 2003 and service pack1 I am seeing
allocation calls from my driver failing and there by causing a crash.
If I analyze the memory usage from the crash using !vm I see extensive
physical memory usage,but the rest of the info seems normal. In all
the scenarios of low memory that I have seen earlier, I used to see
extensive paged pool usage or PTE exhaustion which leads to these type
of issues. I know how to fix/prevent the crash from my driver, but
was more interested in knowing what exactly would lead to the
extensive physical memory usage. Any hints ?

I have pasted the !vm o/p below

0: kd> !vm

*** Virtual Memory Usage ***
Physical Memory: 2096201 (16769608 Kb)
Page File: ??\C:\pagefile.sys
Current: 2095104Kb Free Space: 2087040Kb
Minimum: 2095104Kb Maximum: 4190208Kb
Available Pages: 1962847 (15702776 Kb)
ResAvail Pages: 145 ( 1160 Kb)

********** Running out of physical memory **********

Locked IO Pages: 154 ( 1232 Kb)
Free System PTEs: 16764123 (134112984 Kb)
Free NP PTEs: 817150 ( 6537200 Kb)
Free Special NP: 0 ( 0 Kb)
Modified Pages: 145 ( 1160 Kb)
Modified PF Pages: 121 ( 968 Kb)
NonPagedPool Usage: 4497 ( 35976 Kb)
NonPagedPool Max: 834559 ( 6676472 Kb)
PagedPool 0 Usage: 1348 ( 10784 Kb)
PagedPool 1 Usage: 118 ( 944 Kb)
PagedPool 2 Usage: 120 ( 960 Kb)
PagedPool 3 Usage: 116 ( 928 Kb)
PagedPool 4 Usage: 114 ( 912 Kb)
PagedPool Usage: 1816 ( 14528 Kb)
PagedPool Maximum: 3338240 (26705920 Kb)
Shared Commit: 1472 ( 11776 Kb)
Special Pool: 0 ( 0 Kb)
Shared Process: 2900 ( 23200 Kb)
PagedPool Commit: 1816 ( 14528 Kb)
Driver Commit: 1978 ( 15824 Kb)
Committed pages: 81551 ( 652408 Kb)
Commit limit: 2302966 (18423728 Kb)

Total Private: 69449 ( 555592 Kb)

Thanks in advance
Anees

The generic answer to large memory usage would be that some process is
hogging or leaking memory. Which of the two is hard to say without knowing
much more about what’s going on in the system… One suspect for this is
obviously your driver, either directly (you allocate memory without regard
to others or loosing track of it) or indirectly (you make calls to some
system component that causes it to allocate memory on your behalf, and then
don’t free up the resource).

But that’s obviously pure speculation, and there may be all sorts of other
causes/reasons for this behaviour.


Mats

xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:

Hello all,
On an IA 64 box with Windows 2003 and service pack1 I am seeing
allocation calls from my driver failing and there by causing a crash.
If I analyze the memory usage from the crash using !vm I see extensive
physical memory usage,but the rest of the info seems normal. In all
the scenarios of low memory that I have seen earlier, I used to see
extensive paged pool usage or PTE exhaustion which leads to these type
of issues. I know how to fix/prevent the crash from my driver, but
was more interested in knowing what exactly would lead to the
extensive physical memory usage. Any hints ?

I have pasted the !vm o/p below

0: kd> !vm

*** Virtual Memory Usage ***
Physical Memory: 2096201 (16769608 Kb)
Page File: ??\C:\pagefile.sys
Current: 2095104Kb Free Space: 2087040Kb
Minimum: 2095104Kb Maximum: 4190208Kb
Available Pages: 1962847 (15702776 Kb)
ResAvail Pages: 145 ( 1160 Kb)

********** Running out of physical memory **********

Locked IO Pages: 154 ( 1232 Kb)
Free System PTEs: 16764123 (134112984 Kb)
Free NP PTEs: 817150 ( 6537200 Kb)
Free Special NP: 0 ( 0 Kb)
Modified Pages: 145 ( 1160 Kb)
Modified PF Pages: 121 ( 968 Kb)
NonPagedPool Usage: 4497 ( 35976 Kb)
NonPagedPool Max: 834559 ( 6676472 Kb)
PagedPool 0 Usage: 1348 ( 10784 Kb)
PagedPool 1 Usage: 118 ( 944 Kb)
PagedPool 2 Usage: 120 ( 960 Kb)
PagedPool 3 Usage: 116 ( 928 Kb)
PagedPool 4 Usage: 114 ( 912 Kb)
PagedPool Usage: 1816 ( 14528 Kb)
PagedPool Maximum: 3338240 (26705920 Kb)
Shared Commit: 1472 ( 11776 Kb)
Special Pool: 0 ( 0 Kb)
Shared Process: 2900 ( 23200 Kb)
PagedPool Commit: 1816 ( 14528 Kb)
Driver Commit: 1978 ( 15824 Kb)
Committed pages: 81551 ( 652408 Kb)
Commit limit: 2302966 (18423728 Kb)

Total Private: 69449 ( 555592 Kb)

Thanks in advance
Anees


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

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

ForwardSourceID:NT000107B6

Actaully, the more generic answer is that since your driver crashes due to a
memory allocation failure, you have a bug in your driver.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Mats PETERSSON” wrote in message
news:xxxxx@ntdev…
>
>
>
>
>
> The generic answer to large memory usage would be that some process is
> hogging or leaking memory. Which of the two is hard to say without knowing
> much more about what’s going on in the system… One suspect for this is
> obviously your driver, either directly (you allocate memory without regard
> to others or loosing track of it) or indirectly (you make calls to some
> system component that causes it to allocate memory on your behalf, and
> then
> don’t free up the resource).
>
> But that’s obviously pure speculation, and there may be all sorts of other
> causes/reasons for this behaviour.
>
> –
> Mats
>
>
> xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
>
>> Hello all,
>> On an IA 64 box with Windows 2003 and service pack1 I am seeing
>> allocation calls from my driver failing and there by causing a crash.
>> If I analyze the memory usage from the crash using !vm I see extensive
>> physical memory usage,but the rest of the info seems normal. In all
>> the scenarios of low memory that I have seen earlier, I used to see
>> extensive paged pool usage or PTE exhaustion which leads to these type
>> of issues. I know how to fix/prevent the crash from my driver, but
>> was more interested in knowing what exactly would lead to the
>> extensive physical memory usage. Any hints ?
>>
>> I have pasted the !vm o/p below
>>
>> 0: kd> !vm
>>
>> Virtual Memory Usage
>> Physical Memory: 2096201 (16769608 Kb)
>> Page File: ??\C:\pagefile.sys
>> Current: 2095104Kb Free Space: 2087040Kb
>> Minimum: 2095104Kb Maximum: 4190208Kb
>> Available Pages: 1962847 (15702776 Kb)
>> ResAvail Pages: 145 ( 1160 Kb)
>>
>> Running out of physical memory
>>
>> Locked IO Pages: 154 ( 1232 Kb)
>> Free System PTEs: 16764123 (134112984 Kb)
>> Free NP PTEs: 817150 ( 6537200 Kb)
>> Free Special NP: 0 ( 0 Kb)
>> Modified Pages: 145 ( 1160 Kb)
>> Modified PF Pages: 121 ( 968 Kb)
>> NonPagedPool Usage: 4497 ( 35976 Kb)
>> NonPagedPool Max: 834559 ( 6676472 Kb)
>> PagedPool 0 Usage: 1348 ( 10784 Kb)
>> PagedPool 1 Usage: 118 ( 944 Kb)
>> PagedPool 2 Usage: 120 ( 960 Kb)
>> PagedPool 3 Usage: 116 ( 928 Kb)
>> PagedPool 4 Usage: 114 ( 912 Kb)
>> PagedPool Usage: 1816 ( 14528 Kb)
>> PagedPool Maximum: 3338240 (26705920 Kb)
>> Shared Commit: 1472 ( 11776 Kb)
>> Special Pool: 0 ( 0 Kb)
>> Shared Process: 2900 ( 23200 Kb)
>> PagedPool Commit: 1816 ( 14528 Kb)
>> Driver Commit: 1978 ( 15824 Kb)
>> Committed pages: 81551 ( 652408 Kb)
>> Commit limit: 2302966 (18423728 Kb)
>>
>> Total Private: 69449 ( 555592 Kb)
>>
>>
>> Thanks in advance
>> Anees
>>
>> —
>> Questions? First check the Kernel Driver FAQ at http://www.
>> osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>> ForwardSourceID:NT000107B6
>
>

Don/Mats,

Thanx for your answers, I agree that i have a bug in my code which
doesn’t handle allocation failures properly, but i am sure my driver
is not leaking memory. What I am rather interested in is to know why
there is a physical memory extensive usage even though the paged/non
paged pool usage , PTE usage etc displayed by the !vm extension is no
where near the maximum limits.

Thanks again,
Anees

On Apr 11, 2005 7:14 PM, Don Burn wrote:
> Actaully, the more generic answer is that since your driver crashes due to a
> memory allocation failure, you have a bug in your driver.
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
> “Mats PETERSSON” wrote in message
> news:xxxxx@ntdev…
> >
> >
> >
> >
> >
> > The generic answer to large memory usage would be that some process is
> > hogging or leaking memory. Which of the two is hard to say without knowing
> > much more about what’s going on in the system… One suspect for this is
> > obviously your driver, either directly (you allocate memory without regard
> > to others or loosing track of it) or indirectly (you make calls to some
> > system component that causes it to allocate memory on your behalf, and
> > then
> > don’t free up the resource).
> >
> > But that’s obviously pure speculation, and there may be all sorts of other
> > causes/reasons for this behaviour.
> >
> > –
> > Mats
> >
> >
> > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> >
> >> Hello all,
> >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> >> allocation calls from my driver failing and there by causing a crash.
> >> If I analyze the memory usage from the crash using !vm I see extensive
> >> physical memory usage,but the rest of the info seems normal. In all
> >> the scenarios of low memory that I have seen earlier, I used to see
> >> extensive paged pool usage or PTE exhaustion which leads to these type
> >> of issues. I know how to fix/prevent the crash from my driver, but
> >> was more interested in knowing what exactly would lead to the
> >> extensive physical memory usage. Any hints ?
> >>
> >> I have pasted the !vm o/p below
> >>
> >> 0: kd> !vm
> >>
> >> Virtual Memory Usage
> >> Physical Memory: 2096201 (16769608 Kb)
> >> Page File: ??\C:\pagefile.sys
> >> Current: 2095104Kb Free Space: 2087040Kb
> >> Minimum: 2095104Kb Maximum: 4190208Kb
> >> Available Pages: 1962847 (15702776 Kb)
> >> ResAvail Pages: 145 ( 1160 Kb)
> >>
> >> Running out of physical memory
> >>
> >> Locked IO Pages: 154 ( 1232 Kb)
> >> Free System PTEs: 16764123 (134112984 Kb)
> >> Free NP PTEs: 817150 ( 6537200 Kb)
> >> Free Special NP: 0 ( 0 Kb)
> >> Modified Pages: 145 ( 1160 Kb)
> >> Modified PF Pages: 121 ( 968 Kb)
> >> NonPagedPool Usage: 4497 ( 35976 Kb)
> >> NonPagedPool Max: 834559 ( 6676472 Kb)
> >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> >> PagedPool 1 Usage: 118 ( 944 Kb)
> >> PagedPool 2 Usage: 120 ( 960 Kb)
> >> PagedPool 3 Usage: 116 ( 928 Kb)
> >> PagedPool 4 Usage: 114 ( 912 Kb)
> >> PagedPool Usage: 1816 ( 14528 Kb)
> >> PagedPool Maximum: 3338240 (26705920 Kb)
> >> Shared Commit: 1472 ( 11776 Kb)
> >> Special Pool: 0 ( 0 Kb)
> >> Shared Process: 2900 ( 23200 Kb)
> >> PagedPool Commit: 1816 ( 14528 Kb)
> >> Driver Commit: 1978 ( 15824 Kb)
> >> Committed pages: 81551 ( 652408 Kb)
> >> Commit limit: 2302966 (18423728 Kb)
> >>
> >> Total Private: 69449 ( 555592 Kb)
> >>
> >>
> >> Thanks in advance
> >> Anees
> >>
> >> —
> >> Questions? First check the Kernel Driver FAQ at http://www.
> >> osronline.com/article.cfm?id=256
> >>
> >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >> ForwardSourceID:NT000107B6
> >
> >
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

You can’t directly tie the number of PTE’s available to the actual physical
memory available. It’s entirely possible that the PTE’s are set up to cope
with 1TB of RAM (just because it’s possible to do that), whilst your system
has 2GB of RAM. Also consider that it may well be a lot of 2MB pages in
use, which means that it only takes one PTE entry for every 2MB, which
would use 1000 PTE’s for the whole of your 2GB of physical memory.

Other maximums may also not be “real” maximums, but the maximum that the
current OS design/setup allows.

There are some other useful tools in WinDBG to analyse memory usage:
!memusage - gives summary of what the memory is used for.
!gflag - enable tagging of memory allocations, which helps in analyzing who
owns the memory.

Driver Verifier may also be used to help analyze memory problems sometimes.
!verifier - get info from verifiers work.


Mats
xxxxx@lists.osr.com wrote on 04/12/2005 06:15:32 AM:

Don/Mats,

Thanx for your answers, I agree that i have a bug in my code which
doesn’t handle allocation failures properly, but i am sure my driver
is not leaking memory. What I am rather interested in is to know why
there is a physical memory extensive usage even though the paged/non
paged pool usage , PTE usage etc displayed by the !vm extension is no
where near the maximum limits.

Thanks again,
Anees

On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > Actaully, the more generic answer is that since your driver crashes due
to a
> > memory allocation failure, you have a bug in your driver.
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> > “Mats PETERSSON” wrote in message
> > news:xxxxx@ntdev…
> > >
> > >
> > >
> > >
> > >
> > > The generic answer to large memory usage would be that some process
is
> > > hogging or leaking memory. Which of the two is hard to say without
knowing
> > > much more about what’s going on in the system… One suspect for this
is
> > > obviously your driver, either directly (you allocate memory without
regard
> > > to others or loosing track of it) or indirectly (you make calls to
some
> > > system component that causes it to allocate memory on your behalf,
and
> > > then
> > > don’t free up the resource).
> > >
> > > But that’s obviously pure speculation, and there may be all sorts of
other
> > > causes/reasons for this behaviour.
> > >
> > > –
> > > Mats
> > >
> > >
> > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > >
> > >> Hello all,
> > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > >> allocation calls from my driver failing and there by causing a
crash.
> > >> If I analyze the memory usage from the crash using !vm I see
extensive
> > >> physical memory usage,but the rest of the info seems normal. In all
> > >> the scenarios of low memory that I have seen earlier, I used to see
> > >> extensive paged pool usage or PTE exhaustion which leads to these
type
> > >> of issues. I know how to fix/prevent the crash from my driver, but
> > >> was more interested in knowing what exactly would lead to the
> > >> extensive physical memory usage. Any hints ?
> > >>
> > >> I have pasted the !vm o/p below
> > >>
> > >> 0: kd> !vm
> > >>
> > >> Virtual Memory Usage
> > >> Physical Memory: 2096201 (16769608 Kb)
> > >> Page File: ??\C:\pagefile.sys
> > >> Current: 2095104Kb Free Space: 2087040Kb
> > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > >> Available Pages: 1962847 (15702776 Kb)
> > >> ResAvail Pages: 145 ( 1160 Kb)
> > >>
> > >> Running out of physical memory
> > >>
> > >> Locked IO Pages: 154 ( 1232 Kb)
> > >> Free System PTEs: 16764123 (134112984 Kb)
> > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > >> Free Special NP: 0 ( 0 Kb)
> > >> Modified Pages: 145 ( 1160 Kb)
> > >> Modified PF Pages: 121 ( 968 Kb)
> > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > >> PagedPool Usage: 1816 ( 14528 Kb)
> > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > >> Shared Commit: 1472 ( 11776 Kb)
> > >> Special Pool: 0 ( 0 Kb)
> > >> Shared Process: 2900 ( 23200 Kb)
> > >> PagedPool Commit: 1816 ( 14528 Kb)
> > >> Driver Commit: 1978 ( 15824 Kb)
> > >> Committed pages: 81551 ( 652408 Kb)
> > >> Commit limit: 2302966 (18423728 Kb)
> > >>
> > >> Total Private: 69449 ( 555592 Kb)
> > >>
> > >>
> > >> Thanks in advance
> > >> Anees
> > >>
> > >> —
> > >> Questions? First check the Kernel Driver FAQ at http://www.
> > >> osronline.com/article.cfm?id=256
> > >>
> > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > >> To unsubscribe send a blank email to
xxxxx@lists.osr.com
> > >
> > >> ForwardSourceID:NT000107B6
> > >
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

> ForwardSourceID:NT00010866

But “Inside windows 2000” says all these maximums are calculated based
on available memory on the host at boot time.
“Both nonpaged and paged pool start at an initial size based on the
amount of physical memory on the system and then grow, if necessary,
up to a maximum size computed at system boot time”

“System PTEs aren’t an infinite resource?Windows 2000 calculates how
many system PTEs to allocate based on the memory size”

Thanks
Anees

On Apr 12, 2005 3:35 PM, Mats PETERSSON wrote:
>
>
> You can’t directly tie the number of PTE’s available to the actual physical
> memory available. It’s entirely possible that the PTE’s are set up to cope
> with 1TB of RAM (just because it’s possible to do that), whilst your system
> has 2GB of RAM. Also consider that it may well be a lot of 2MB pages in
> use, which means that it only takes one PTE entry for every 2MB, which
> would use 1000 PTE’s for the whole of your 2GB of physical memory.
>
> Other maximums may also not be “real” maximums, but the maximum that the
> current OS design/setup allows.
>
> There are some other useful tools in WinDBG to analyse memory usage:
> !memusage - gives summary of what the memory is used for.
> !gflag - enable tagging of memory allocations, which helps in analyzing who
> owns the memory.
>
> Driver Verifier may also be used to help analyze memory problems sometimes.
> !verifier - get info from verifiers work.
>
> –
> Mats
> xxxxx@lists.osr.com wrote on 04/12/2005 06:15:32 AM:
>
> > Don/Mats,
> >
> > Thanx for your answers, I agree that i have a bug in my code which
> > doesn’t handle allocation failures properly, but i am sure my driver
> > is not leaking memory. What I am rather interested in is to know why
> > there is a physical memory extensive usage even though the paged/non
> > paged pool usage , PTE usage etc displayed by the !vm extension is no
> > where near the maximum limits.
> >
> > Thanks again,
> > Anees
> >
> > On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > > Actaully, the more generic answer is that since your driver crashes due
> to a
> > > memory allocation failure, you have a bug in your driver.
> > >
> > > –
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > “Mats PETERSSON” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The generic answer to large memory usage would be that some process
> is
> > > > hogging or leaking memory. Which of the two is hard to say without
> knowing
> > > > much more about what’s going on in the system… One suspect for this
> is
> > > > obviously your driver, either directly (you allocate memory without
> regard
> > > > to others or loosing track of it) or indirectly (you make calls to
> some
> > > > system component that causes it to allocate memory on your behalf,
> and
> > > > then
> > > > don’t free up the resource).
> > > >
> > > > But that’s obviously pure speculation, and there may be all sorts of
> other
> > > > causes/reasons for this behaviour.
> > > >
> > > > –
> > > > Mats
> > > >
> > > >
> > > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > > >
> > > >> Hello all,
> > > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > > >> allocation calls from my driver failing and there by causing a
> crash.
> > > >> If I analyze the memory usage from the crash using !vm I see
> extensive
> > > >> physical memory usage,but the rest of the info seems normal. In all
> > > >> the scenarios of low memory that I have seen earlier, I used to see
> > > >> extensive paged pool usage or PTE exhaustion which leads to these
> type
> > > >> of issues. I know how to fix/prevent the crash from my driver, but
> > > >> was more interested in knowing what exactly would lead to the
> > > >> extensive physical memory usage. Any hints ?
> > > >>
> > > >> I have pasted the !vm o/p below
> > > >>
> > > >> 0: kd> !vm
> > > >>
> > > >> Virtual Memory Usage
> > > >> Physical Memory: 2096201 (16769608 Kb)
> > > >> Page File: ??\C:\pagefile.sys
> > > >> Current: 2095104Kb Free Space: 2087040Kb
> > > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > > >> Available Pages: 1962847 (15702776 Kb)
> > > >> ResAvail Pages: 145 ( 1160 Kb)
> > > >>
> > > >> Running out of physical memory
> > > >>
> > > >> Locked IO Pages: 154 ( 1232 Kb)
> > > >> Free System PTEs: 16764123 (134112984 Kb)
> > > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > > >> Free Special NP: 0 ( 0 Kb)
> > > >> Modified Pages: 145 ( 1160 Kb)
> > > >> Modified PF Pages: 121 ( 968 Kb)
> > > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > > >> PagedPool Usage: 1816 ( 14528 Kb)
> > > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > > >> Shared Commit: 1472 ( 11776 Kb)
> > > >> Special Pool: 0 ( 0 Kb)
> > > >> Shared Process: 2900 ( 23200 Kb)
> > > >> PagedPool Commit: 1816 ( 14528 Kb)
> > > >> Driver Commit: 1978 ( 15824 Kb)
> > > >> Committed pages: 81551 ( 652408 Kb)
> > > >> Commit limit: 2302966 (18423728 Kb)
> > > >>
> > > >> Total Private: 69449 ( 555592 Kb)
> > > >>
> > > >>
> > > >> Thanks in advance
> > > >> Anees
> > > >>
> > > >> —
> > > >> Questions? First check the Kernel Driver FAQ at http://www.
> > > >> osronline.com/article.cfm?id=256
> > > >>
> > > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > > >> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> > > >
> > > >> ForwardSourceID:NT000107B6
> > > >
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at http://www.
> > osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at http://www.
> > osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> > ForwardSourceID:NT00010866
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

!memusage is another command that is useful in these circumstances – it
will summarize physical page usage (and I would guess you have a lot of
modified pages or possibly even mod-nowrite pages if there is a bug in your
driver) as opposed to virtual usage that !vm shows.

/simgr

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
Sent: Tuesday, April 12, 2005 1:16 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Physical memory usage

Don/Mats,

Thanx for your answers, I agree that i have a bug in my code which
doesn’t handle allocation failures properly, but i am sure my driver
is not leaking memory. What I am rather interested in is to know why
there is a physical memory extensive usage even though the paged/non
paged pool usage , PTE usage etc displayed by the !vm extension is no
where near the maximum limits.

Thanks again,
Anees

On Apr 11, 2005 7:14 PM, Don Burn wrote:
> Actaully, the more generic answer is that since your driver crashes due to
a
> memory allocation failure, you have a bug in your driver.
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
> “Mats PETERSSON” wrote in message
> news:xxxxx@ntdev…
> >
> >
> >
> >
> >
> > The generic answer to large memory usage would be that some process is
> > hogging or leaking memory. Which of the two is hard to say without
knowing
> > much more about what’s going on in the system… One suspect for this is
> > obviously your driver, either directly (you allocate memory without
regard
> > to others or loosing track of it) or indirectly (you make calls to some
> > system component that causes it to allocate memory on your behalf, and
> > then
> > don’t free up the resource).
> >
> > But that’s obviously pure speculation, and there may be all sorts of
other
> > causes/reasons for this behaviour.
> >
> > –
> > Mats
> >
> >
> > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> >
> >> Hello all,
> >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> >> allocation calls from my driver failing and there by causing a crash.
> >> If I analyze the memory usage from the crash using !vm I see extensive
> >> physical memory usage,but the rest of the info seems normal. In all
> >> the scenarios of low memory that I have seen earlier, I used to see
> >> extensive paged pool usage or PTE exhaustion which leads to these type
> >> of issues. I know how to fix/prevent the crash from my driver, but
> >> was more interested in knowing what exactly would lead to the
> >> extensive physical memory usage. Any hints ?
> >>
> >> I have pasted the !vm o/p below
> >>
> >> 0: kd> !vm
> >>
> >> Virtual Memory Usage
> >> Physical Memory: 2096201 (16769608 Kb)
> >> Page File: ??\C:\pagefile.sys
> >> Current: 2095104Kb Free Space: 2087040Kb
> >> Minimum: 2095104Kb Maximum: 4190208Kb
> >> Available Pages: 1962847 (15702776 Kb)
> >> ResAvail Pages: 145 ( 1160 Kb)
> >>
> >> Running out of physical memory
> >>
> >> Locked IO Pages: 154 ( 1232 Kb)
> >> Free System PTEs: 16764123 (134112984 Kb)
> >> Free NP PTEs: 817150 ( 6537200 Kb)
> >> Free Special NP: 0 ( 0 Kb)
> >> Modified Pages: 145 ( 1160 Kb)
> >> Modified PF Pages: 121 ( 968 Kb)
> >> NonPagedPool Usage: 4497 ( 35976 Kb)
> >> NonPagedPool Max: 834559 ( 6676472 Kb)
> >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> >> PagedPool 1 Usage: 118 ( 944 Kb)
> >> PagedPool 2 Usage: 120 ( 960 Kb)
> >> PagedPool 3 Usage: 116 ( 928 Kb)
> >> PagedPool 4 Usage: 114 ( 912 Kb)
> >> PagedPool Usage: 1816 ( 14528 Kb)
> >> PagedPool Maximum: 3338240 (26705920 Kb)
> >> Shared Commit: 1472 ( 11776 Kb)
> >> Special Pool: 0 ( 0 Kb)
> >> Shared Process: 2900 ( 23200 Kb)
> >> PagedPool Commit: 1816 ( 14528 Kb)
> >> Driver Commit: 1978 ( 15824 Kb)
> >> Committed pages: 81551 ( 652408 Kb)
> >> Commit limit: 2302966 (18423728 Kb)
> >>
> >> Total Private: 69449 ( 555592 Kb)
> >>
> >>
> >> Thanks in advance
> >> Anees
> >>
> >> —
> >> Questions? First check the Kernel Driver FAQ at http://www.
> >> osronline.com/article.cfm?id=256
> >>
> >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >> ForwardSourceID:NT000107B6
> >
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

I’ve tried to going thru the !memusage output, put to be frank i dont
know on how exactly i map it to a conclusion on what/who is eating up
the memory. Here is the summary of the command output

0: kd> !memusage
loading PFN database
loading (100% complete)
Compiling memory usage data (99% Complete).
Zeroed: 1947857 (15582856 kb)
Free: 7 ( 56 kb)
Standby: 14983 (119864 kb)
Modified: 145 ( 1160 kb)
ModifiedNoWrite: 0 ( 0 kb)
Active/Valid: 133200 (1065600 kb)
Transition: 9 ( 72 kb)
Unknown: 0 ( 0 kb)
TOTAL: 2096201 (16769608 kb)
Building kernel map
Finished building kernel map

On Apr 12, 2005 6:35 PM, Graham, Simon wrote:
> !memusage is another command that is useful in these circumstances – it
> will summarize physical page usage (and I would guess you have a lot of
> modified pages or possibly even mod-nowrite pages if there is a bug in your
> driver) as opposed to virtual usage that !vm shows.
>
> /simgr
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> Sent: Tuesday, April 12, 2005 1:16 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Physical memory usage
>
> Don/Mats,
>
> Thanx for your answers, I agree that i have a bug in my code which
> doesn’t handle allocation failures properly, but i am sure my driver
> is not leaking memory. What I am rather interested in is to know why
> there is a physical memory extensive usage even though the paged/non
> paged pool usage , PTE usage etc displayed by the !vm extension is no
> where near the maximum limits.
>
> Thanks again,
> Anees
>
> On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > Actaully, the more generic answer is that since your driver crashes due to
> a
> > memory allocation failure, you have a bug in your driver.
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> > “Mats PETERSSON” wrote in message
> > news:xxxxx@ntdev…
> > >
> > >
> > >
> > >
> > >
> > > The generic answer to large memory usage would be that some process is
> > > hogging or leaking memory. Which of the two is hard to say without
> knowing
> > > much more about what’s going on in the system… One suspect for this is
> > > obviously your driver, either directly (you allocate memory without
> regard
> > > to others or loosing track of it) or indirectly (you make calls to some
> > > system component that causes it to allocate memory on your behalf, and
> > > then
> > > don’t free up the resource).
> > >
> > > But that’s obviously pure speculation, and there may be all sorts of
> other
> > > causes/reasons for this behaviour.
> > >
> > > –
> > > Mats
> > >
> > >
> > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > >
> > >> Hello all,
> > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > >> allocation calls from my driver failing and there by causing a crash.
> > >> If I analyze the memory usage from the crash using !vm I see extensive
> > >> physical memory usage,but the rest of the info seems normal. In all
> > >> the scenarios of low memory that I have seen earlier, I used to see
> > >> extensive paged pool usage or PTE exhaustion which leads to these type
> > >> of issues. I know how to fix/prevent the crash from my driver, but
> > >> was more interested in knowing what exactly would lead to the
> > >> extensive physical memory usage. Any hints ?
> > >>
> > >> I have pasted the !vm o/p below
> > >>
> > >> 0: kd> !vm
> > >>
> > >> Virtual Memory Usage
> > >> Physical Memory: 2096201 (16769608 Kb)
> > >> Page File: ??\C:\pagefile.sys
> > >> Current: 2095104Kb Free Space: 2087040Kb
> > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > >> Available Pages: 1962847 (15702776 Kb)
> > >> ResAvail Pages: 145 ( 1160 Kb)
> > >>
> > >> Running out of physical memory
> > >>
> > >> Locked IO Pages: 154 ( 1232 Kb)
> > >> Free System PTEs: 16764123 (134112984 Kb)
> > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > >> Free Special NP: 0 ( 0 Kb)
> > >> Modified Pages: 145 ( 1160 Kb)
> > >> Modified PF Pages: 121 ( 968 Kb)
> > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > >> PagedPool Usage: 1816 ( 14528 Kb)
> > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > >> Shared Commit: 1472 ( 11776 Kb)
> > >> Special Pool: 0 ( 0 Kb)
> > >> Shared Process: 2900 ( 23200 Kb)
> > >> PagedPool Commit: 1816 ( 14528 Kb)
> > >> Driver Commit: 1978 ( 15824 Kb)
> > >> Committed pages: 81551 ( 652408 Kb)
> > >> Commit limit: 2302966 (18423728 Kb)
> > >>
> > >> Total Private: 69449 ( 555592 Kb)
> > >>
> > >>
> > >> Thanks in advance
> > >> Anees
> > >>
> > >> —
> > >> Questions? First check the Kernel Driver FAQ at http://www.
> > >> osronline.com/article.cfm?id=256
> > >>
> > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >> ForwardSourceID:NT000107B6
> > >
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Lately, i just noticed that zeroed row in the !memusage output. From
what i know they are the pages that are actually free and has been
zeroed out by the zero page thread. So is it that the !vm o/p is
giving me wrong information regarding the physical memory usage?

In that case, what could be the other reasons that result in
allocation failures ? I agree again that i can handle the allocation
failure in my code, but would be interested in knowing what all could
lead to allocation failures.

Thanks
Anees

On Apr 12, 2005 10:31 PM, Anees M wrote:
> I’ve tried to going thru the !memusage output, put to be frank i dont
> know on how exactly i map it to a conclusion on what/who is eating up
> the memory. Here is the summary of the command output
>
> 0: kd> !memusage
> loading PFN database
> loading (100% complete)
> Compiling memory usage data (99% Complete).
> Zeroed: 1947857 (15582856 kb)
> Free: 7 ( 56 kb)
> Standby: 14983 (119864 kb)
> Modified: 145 ( 1160 kb)
> ModifiedNoWrite: 0 ( 0 kb)
> Active/Valid: 133200 (1065600 kb)
> Transition: 9 ( 72 kb)
> Unknown: 0 ( 0 kb)
> TOTAL: 2096201 (16769608 kb)
> Building kernel map
> Finished building kernel map
>
>
> On Apr 12, 2005 6:35 PM, Graham, Simon wrote:
> > !memusage is another command that is useful in these circumstances – it
> > will summarize physical page usage (and I would guess you have a lot of
> > modified pages or possibly even mod-nowrite pages if there is a bug in your
> > driver) as opposed to virtual usage that !vm shows.
> >
> > /simgr
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> > Sent: Tuesday, April 12, 2005 1:16 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Physical memory usage
> >
> > Don/Mats,
> >
> > Thanx for your answers, I agree that i have a bug in my code which
> > doesn’t handle allocation failures properly, but i am sure my driver
> > is not leaking memory. What I am rather interested in is to know why
> > there is a physical memory extensive usage even though the paged/non
> > paged pool usage , PTE usage etc displayed by the !vm extension is no
> > where near the maximum limits.
> >
> > Thanks again,
> > Anees
> >
> > On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > > Actaully, the more generic answer is that since your driver crashes due to
> > a
> > > memory allocation failure, you have a bug in your driver.
> > >
> > > –
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > “Mats PETERSSON” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The generic answer to large memory usage would be that some process is
> > > > hogging or leaking memory. Which of the two is hard to say without
> > knowing
> > > > much more about what’s going on in the system… One suspect for this is
> > > > obviously your driver, either directly (you allocate memory without
> > regard
> > > > to others or loosing track of it) or indirectly (you make calls to some
> > > > system component that causes it to allocate memory on your behalf, and
> > > > then
> > > > don’t free up the resource).
> > > >
> > > > But that’s obviously pure speculation, and there may be all sorts of
> > other
> > > > causes/reasons for this behaviour.
> > > >
> > > > –
> > > > Mats
> > > >
> > > >
> > > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > > >
> > > >> Hello all,
> > > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > > >> allocation calls from my driver failing and there by causing a crash.
> > > >> If I analyze the memory usage from the crash using !vm I see extensive
> > > >> physical memory usage,but the rest of the info seems normal. In all
> > > >> the scenarios of low memory that I have seen earlier, I used to see
> > > >> extensive paged pool usage or PTE exhaustion which leads to these type
> > > >> of issues. I know how to fix/prevent the crash from my driver, but
> > > >> was more interested in knowing what exactly would lead to the
> > > >> extensive physical memory usage. Any hints ?
> > > >>
> > > >> I have pasted the !vm o/p below
> > > >>
> > > >> 0: kd> !vm
> > > >>
> > > >> Virtual Memory Usage
> > > >> Physical Memory: 2096201 (16769608 Kb)
> > > >> Page File: ??\C:\pagefile.sys
> > > >> Current: 2095104Kb Free Space: 2087040Kb
> > > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > > >> Available Pages: 1962847 (15702776 Kb)
> > > >> ResAvail Pages: 145 ( 1160 Kb)
> > > >>
> > > >> Running out of physical memory
> > > >>
> > > >> Locked IO Pages: 154 ( 1232 Kb)
> > > >> Free System PTEs: 16764123 (134112984 Kb)
> > > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > > >> Free Special NP: 0 ( 0 Kb)
> > > >> Modified Pages: 145 ( 1160 Kb)
> > > >> Modified PF Pages: 121 ( 968 Kb)
> > > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > > >> PagedPool Usage: 1816 ( 14528 Kb)
> > > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > > >> Shared Commit: 1472 ( 11776 Kb)
> > > >> Special Pool: 0 ( 0 Kb)
> > > >> Shared Process: 2900 ( 23200 Kb)
> > > >> PagedPool Commit: 1816 ( 14528 Kb)
> > > >> Driver Commit: 1978 ( 15824 Kb)
> > > >> Committed pages: 81551 ( 652408 Kb)
> > > >> Commit limit: 2302966 (18423728 Kb)
> > > >>
> > > >> Total Private: 69449 ( 555592 Kb)
> > > >>
> > > >>
> > > >> Thanks in advance
> > > >> Anees
> > > >>
> > > >> —
> > > >> Questions? First check the Kernel Driver FAQ at http://www.
> > > >> osronline.com/article.cfm?id=256
> > > >>
> > > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > > >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > > >> ForwardSourceID:NT000107B6
> > > >
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>

OK - nothing obviously wrong here you have PLENTY of physical memory
available – so, tell us more about the exact allocation call that is
failing… (type, size, etc)

/simgr

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
Sent: Tuesday, April 12, 2005 1:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Physical memory usage

I’ve tried to going thru the !memusage output, put to be frank i dont
know on how exactly i map it to a conclusion on what/who is eating up
the memory. Here is the summary of the command output

0: kd> !memusage
loading PFN database
loading (100% complete)
Compiling memory usage data (99% Complete).
Zeroed: 1947857 (15582856 kb)
Free: 7 ( 56 kb)
Standby: 14983 (119864 kb)
Modified: 145 ( 1160 kb)
ModifiedNoWrite: 0 ( 0 kb)
Active/Valid: 133200 (1065600 kb)
Transition: 9 ( 72 kb)
Unknown: 0 ( 0 kb)
TOTAL: 2096201 (16769608 kb)
Building kernel map
Finished building kernel map

On Apr 12, 2005 6:35 PM, Graham, Simon wrote:
> !memusage is another command that is useful in these circumstances – it
> will summarize physical page usage (and I would guess you have a lot of
> modified pages or possibly even mod-nowrite pages if there is a bug in
your
> driver) as opposed to virtual usage that !vm shows.
>
> /simgr
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> Sent: Tuesday, April 12, 2005 1:16 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Physical memory usage
>
> Don/Mats,
>
> Thanx for your answers, I agree that i have a bug in my code which
> doesn’t handle allocation failures properly, but i am sure my driver
> is not leaking memory. What I am rather interested in is to know why
> there is a physical memory extensive usage even though the paged/non
> paged pool usage , PTE usage etc displayed by the !vm extension is no
> where near the maximum limits.
>
> Thanks again,
> Anees
>
> On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > Actaully, the more generic answer is that since your driver crashes due
to
> a
> > memory allocation failure, you have a bug in your driver.
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> > “Mats PETERSSON” wrote in message
> > news:xxxxx@ntdev…
> > >
> > >
> > >
> > >
> > >
> > > The generic answer to large memory usage would be that some process is
> > > hogging or leaking memory. Which of the two is hard to say without
> knowing
> > > much more about what’s going on in the system… One suspect for this
is
> > > obviously your driver, either directly (you allocate memory without
> regard
> > > to others or loosing track of it) or indirectly (you make calls to
some
> > > system component that causes it to allocate memory on your behalf, and
> > > then
> > > don’t free up the resource).
> > >
> > > But that’s obviously pure speculation, and there may be all sorts of
> other
> > > causes/reasons for this behaviour.
> > >
> > > –
> > > Mats
> > >
> > >
> > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > >
> > >> Hello all,
> > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > >> allocation calls from my driver failing and there by causing a crash.
> > >> If I analyze the memory usage from the crash using !vm I see
extensive
> > >> physical memory usage,but the rest of the info seems normal. In all
> > >> the scenarios of low memory that I have seen earlier, I used to see
> > >> extensive paged pool usage or PTE exhaustion which leads to these
type
> > >> of issues. I know how to fix/prevent the crash from my driver, but
> > >> was more interested in knowing what exactly would lead to the
> > >> extensive physical memory usage. Any hints ?
> > >>
> > >> I have pasted the !vm o/p below
> > >>
> > >> 0: kd> !vm
> > >>
> > >> Virtual Memory Usage
> > >> Physical Memory: 2096201 (16769608 Kb)
> > >> Page File: ??\C:\pagefile.sys
> > >> Current: 2095104Kb Free Space: 2087040Kb
> > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > >> Available Pages: 1962847 (15702776 Kb)
> > >> ResAvail Pages: 145 ( 1160 Kb)
> > >>
> > >> Running out of physical memory
> > >>
> > >> Locked IO Pages: 154 ( 1232 Kb)
> > >> Free System PTEs: 16764123 (134112984 Kb)
> > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > >> Free Special NP: 0 ( 0 Kb)
> > >> Modified Pages: 145 ( 1160 Kb)
> > >> Modified PF Pages: 121 ( 968 Kb)
> > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > >> PagedPool Usage: 1816 ( 14528 Kb)
> > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > >> Shared Commit: 1472 ( 11776 Kb)
> > >> Special Pool: 0 ( 0 Kb)
> > >> Shared Process: 2900 ( 23200 Kb)
> > >> PagedPool Commit: 1816 ( 14528 Kb)
> > >> Driver Commit: 1978 ( 15824 Kb)
> > >> Committed pages: 81551 ( 652408 Kb)
> > >> Commit limit: 2302966 (18423728 Kb)
> > >>
> > >> Total Private: 69449 ( 555592 Kb)
> > >>
> > >>
> > >> Thanks in advance
> > >> Anees
> > >>
> > >> —
> > >> Questions? First check the Kernel Driver FAQ at http://www.
> > >> osronline.com/article.cfm?id=256
> > >>
> > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >> ForwardSourceID:NT000107B6
> > >
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

I have a function that creates an IRP by calls to IoAllocateSrb and
IoAllocateIrp which is failing. I am analyzing a crash dump and doesnt
have a repro or a live machine to try this out. I still dont know
which among the above two calls is failing as the crash occurs at a
later point in the stack after this function had actually returned,
and would be rather interested in knowing/isolating the reasons for
why they might have failed and could fail in the future.

Thanks
Anees

On Apr 12, 2005 10:57 PM, Graham, Simon wrote:
> OK - nothing obviously wrong here you have PLENTY of physical memory
> available – so, tell us more about the exact allocation call that is
> failing… (type, size, etc)
>
> /simgr
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> Sent: Tuesday, April 12, 2005 1:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Physical memory usage
>
> I’ve tried to going thru the !memusage output, put to be frank i dont
> know on how exactly i map it to a conclusion on what/who is eating up
> the memory. Here is the summary of the command output
>
> 0: kd> !memusage
> loading PFN database
> loading (100% complete)
> Compiling memory usage data (99% Complete).
> Zeroed: 1947857 (15582856 kb)
> Free: 7 ( 56 kb)
> Standby: 14983 (119864 kb)
> Modified: 145 ( 1160 kb)
> ModifiedNoWrite: 0 ( 0 kb)
> Active/Valid: 133200 (1065600 kb)
> Transition: 9 ( 72 kb)
> Unknown: 0 ( 0 kb)
> TOTAL: 2096201 (16769608 kb)
> Building kernel map
> Finished building kernel map
>
> On Apr 12, 2005 6:35 PM, Graham, Simon wrote:
> > !memusage is another command that is useful in these circumstances – it
> > will summarize physical page usage (and I would guess you have a lot of
> > modified pages or possibly even mod-nowrite pages if there is a bug in
> your
> > driver) as opposed to virtual usage that !vm shows.
> >
> > /simgr
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> > Sent: Tuesday, April 12, 2005 1:16 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Physical memory usage
> >
> > Don/Mats,
> >
> > Thanx for your answers, I agree that i have a bug in my code which
> > doesn’t handle allocation failures properly, but i am sure my driver
> > is not leaking memory. What I am rather interested in is to know why
> > there is a physical memory extensive usage even though the paged/non
> > paged pool usage , PTE usage etc displayed by the !vm extension is no
> > where near the maximum limits.
> >
> > Thanks again,
> > Anees
> >
> > On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > > Actaully, the more generic answer is that since your driver crashes due
> to
> > a
> > > memory allocation failure, you have a bug in your driver.
> > >
> > > –
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > “Mats PETERSSON” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The generic answer to large memory usage would be that some process is
> > > > hogging or leaking memory. Which of the two is hard to say without
> > knowing
> > > > much more about what’s going on in the system… One suspect for this
> is
> > > > obviously your driver, either directly (you allocate memory without
> > regard
> > > > to others or loosing track of it) or indirectly (you make calls to
> some
> > > > system component that causes it to allocate memory on your behalf, and
> > > > then
> > > > don’t free up the resource).
> > > >
> > > > But that’s obviously pure speculation, and there may be all sorts of
> > other
> > > > causes/reasons for this behaviour.
> > > >
> > > > –
> > > > Mats
> > > >
> > > >
> > > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > > >
> > > >> Hello all,
> > > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > > >> allocation calls from my driver failing and there by causing a crash.
> > > >> If I analyze the memory usage from the crash using !vm I see
> extensive
> > > >> physical memory usage,but the rest of the info seems normal. In all
> > > >> the scenarios of low memory that I have seen earlier, I used to see
> > > >> extensive paged pool usage or PTE exhaustion which leads to these
> type
> > > >> of issues. I know how to fix/prevent the crash from my driver, but
> > > >> was more interested in knowing what exactly would lead to the
> > > >> extensive physical memory usage. Any hints ?
> > > >>
> > > >> I have pasted the !vm o/p below
> > > >>
> > > >> 0: kd> !vm
> > > >>
> > > >> Virtual Memory Usage
> > > >> Physical Memory: 2096201 (16769608 Kb)
> > > >> Page File: ??\C:\pagefile.sys
> > > >> Current: 2095104Kb Free Space: 2087040Kb
> > > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > > >> Available Pages: 1962847 (15702776 Kb)
> > > >> ResAvail Pages: 145 ( 1160 Kb)
> > > >>
> > > >> Running out of physical memory
> > > >>
> > > >> Locked IO Pages: 154 ( 1232 Kb)
> > > >> Free System PTEs: 16764123 (134112984 Kb)
> > > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > > >> Free Special NP: 0 ( 0 Kb)
> > > >> Modified Pages: 145 ( 1160 Kb)
> > > >> Modified PF Pages: 121 ( 968 Kb)
> > > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > > >> PagedPool Usage: 1816 ( 14528 Kb)
> > > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > > >> Shared Commit: 1472 ( 11776 Kb)
> > > >> Special Pool: 0 ( 0 Kb)
> > > >> Shared Process: 2900 ( 23200 Kb)
> > > >> PagedPool Commit: 1816 ( 14528 Kb)
> > > >> Driver Commit: 1978 ( 15824 Kb)
> > > >> Committed pages: 81551 ( 652408 Kb)
> > > >> Commit limit: 2302966 (18423728 Kb)
> > > >>
> > > >> Total Private: 69449 ( 555592 Kb)
> > > >>
> > > >>
> > > >> Thanks in advance
> > > >> Anees
> > > >>
> > > >> —
> > > >> Questions? First check the Kernel Driver FAQ at http://www.
> > > >> osronline.com/article.cfm?id=256
> > > >>
> > > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > > >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > > >> ForwardSourceID:NT000107B6
> > > >
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

I don’t seem to have an IoAllocateSrb in my ddk. Which OS are you building
this for?

At any rate neither IRP nor SRB allocations ought to fail on your system.
They are both small blocks and you do not appear to have a memory shortage.

=====================
Mark Roddy

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
Sent: Tuesday, April 12, 2005 1:51 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Physical memory usage

I have a function that creates an IRP by calls to IoAllocateSrb and
IoAllocateIrp which is failing. I am analyzing a crash dump and doesnt have
a repro or a live machine to try this out. I still dont know which among the
above two calls is failing as the crash occurs at a later point in the stack
after this function had actually returned, and would be rather interested in
knowing/isolating the reasons for why they might have failed and could fail
in the future.

Thanks
Anees

On Apr 12, 2005 10:57 PM, Graham, Simon wrote:
> OK - nothing obviously wrong here you have PLENTY of physical memory
> available – so, tell us more about the exact allocation call that
> is failing… (type, size, etc)
>
> /simgr
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> Sent: Tuesday, April 12, 2005 1:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Physical memory usage
>
> I’ve tried to going thru the !memusage output, put to be frank i dont
> know on how exactly i map it to a conclusion on what/who is eating up
> the memory. Here is the summary of the command output
>
> 0: kd> !memusage
> loading PFN database
> loading (100% complete)
> Compiling memory usage data (99% Complete).
> Zeroed: 1947857 (15582856 kb)
> Free: 7 ( 56 kb)
> Standby: 14983 (119864 kb)
> Modified: 145 ( 1160 kb)
> ModifiedNoWrite: 0 ( 0 kb)
> Active/Valid: 133200 (1065600 kb)
> Transition: 9 ( 72 kb)
> Unknown: 0 ( 0 kb)
> TOTAL: 2096201 (16769608 kb) Building kernel map
> Finished building kernel map
>
> On Apr 12, 2005 6:35 PM, Graham, Simon wrote:
> > !memusage is another command that is useful in these circumstances
> > – it will summarize physical page usage (and I would guess you have
> > a lot of modified pages or possibly even mod-nowrite pages if there
> > is a bug in
> your
> > driver) as opposed to virtual usage that !vm shows.
> >
> > /simgr
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> > Sent: Tuesday, April 12, 2005 1:16 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Physical memory usage
> >
> > Don/Mats,
> >
> > Thanx for your answers, I agree that i have a bug in my code which
> > doesn’t handle allocation failures properly, but i am sure my driver
> > is not leaking memory. What I am rather interested in is to know why
> > there is a physical memory extensive usage even though the paged/non
> > paged pool usage , PTE usage etc displayed by the !vm extension is
> > no where near the maximum limits.
> >
> > Thanks again,
> > Anees
> >
> > On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > > Actaully, the more generic answer is that since your driver
> > > crashes due
> to
> > a
> > > memory allocation failure, you have a bug in your driver.
> > >
> > > –
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting Remove StopSpam
> > > from the email to reply
> > >
> > > “Mats PETERSSON” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The generic answer to large memory usage would be that some
> > > > process is hogging or leaking memory. Which of the two is hard
> > > > to say without
> > knowing
> > > > much more about what’s going on in the system… One suspect for
> > > > this
> is
> > > > obviously your driver, either directly (you allocate memory
> > > > without
> > regard
> > > > to others or loosing track of it) or indirectly (you make calls
> > > > to
> some
> > > > system component that causes it to allocate memory on your
> > > > behalf, and then don’t free up the resource).
> > > >
> > > > But that’s obviously pure speculation, and there may be all
> > > > sorts of
> > other
> > > > causes/reasons for this behaviour.
> > > >
> > > > –
> > > > Mats
> > > >
> > > >
> > > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > > >
> > > >> Hello all,
> > > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > > >> allocation calls from my driver failing and there by causing a
crash.
> > > >> If I analyze the memory usage from the crash using !vm I see
> extensive
> > > >> physical memory usage,but the rest of the info seems normal. In
> > > >> all the scenarios of low memory that I have seen earlier, I
> > > >> used to see extensive paged pool usage or PTE exhaustion which
> > > >> leads to these
> type
> > > >> of issues. I know how to fix/prevent the crash from my driver,
> > > >> but was more interested in knowing what exactly would lead to
> > > >> the extensive physical memory usage. Any hints ?
> > > >>
> > > >> I have pasted the !vm o/p below
> > > >>
> > > >> 0: kd> !vm
> > > >>
> > > >> Virtual Memory Usage
> > > >> Physical Memory: 2096201 (16769608 Kb)
> > > >> Page File: ??\C:\pagefile.sys
> > > >> Current: 2095104Kb Free Space: 2087040Kb
> > > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > > >> Available Pages: 1962847 (15702776 Kb)
> > > >> ResAvail Pages: 145 ( 1160 Kb)
> > > >>
> > > >> Running out of physical memory
> > > >>
> > > >> Locked IO Pages: 154 ( 1232 Kb)
> > > >> Free System PTEs: 16764123 (134112984 Kb)
> > > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > > >> Free Special NP: 0 ( 0 Kb)
> > > >> Modified Pages: 145 ( 1160 Kb)
> > > >> Modified PF Pages: 121 ( 968 Kb)
> > > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > > >> PagedPool Usage: 1816 ( 14528 Kb)
> > > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > > >> Shared Commit: 1472 ( 11776 Kb)
> > > >> Special Pool: 0 ( 0 Kb)
> > > >> Shared Process: 2900 ( 23200 Kb)
> > > >> PagedPool Commit: 1816 ( 14528 Kb)
> > > >> Driver Commit: 1978 ( 15824 Kb)
> > > >> Committed pages: 81551 ( 652408 Kb)
> > > >> Commit limit: 2302966 (18423728 Kb)
> > > >>
> > > >> Total Private: 69449 ( 555592 Kb)
> > > >>
> > > >>
> > > >> Thanks in advance
> > > >> Anees
> > > >>
> > > >> —
> > > >> Questions? First check the Kernel Driver FAQ at http://www.
> > > >> osronline.com/article.cfm?id=256
> > > >>
> > > >> You are currently subscribed to ntdev as:
> > > >> xxxxx@3dlabs.com To unsubscribe send a blank email to
> > > >> xxxxx@lists.osr.com
> > > >
> > > >> ForwardSourceID:NT000107B6
> > > >
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@gmail.com To
> > > unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Now we’re getting somewhere – but it would help to post the complete info
on the call you are making. Are you specifying TRUE for ChargeQuota? That
can lead to a failure because the current process is out of non-paged pool
quota.

I don’t know what IoAllocateSrb is - I think you meant something else -
IoAllocateMdl? ScsiPortGetSrb?

/simgr

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
Sent: Tuesday, April 12, 2005 1:51 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Physical memory usage

I have a function that creates an IRP by calls to IoAllocateSrb and
IoAllocateIrp which is failing. I am analyzing a crash dump and doesnt
have a repro or a live machine to try this out. I still dont know
which among the above two calls is failing as the crash occurs at a
later point in the stack after this function had actually returned,
and would be rather interested in knowing/isolating the reasons for
why they might have failed and could fail in the future.

Thanks
Anees

On Apr 12, 2005 10:57 PM, Graham, Simon wrote:
> OK - nothing obviously wrong here you have PLENTY of physical memory
> available – so, tell us more about the exact allocation call that is
> failing… (type, size, etc)
>
> /simgr
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> Sent: Tuesday, April 12, 2005 1:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Physical memory usage
>
> I’ve tried to going thru the !memusage output, put to be frank i dont
> know on how exactly i map it to a conclusion on what/who is eating up
> the memory. Here is the summary of the command output
>
> 0: kd> !memusage
> loading PFN database
> loading (100% complete)
> Compiling memory usage data (99% Complete).
> Zeroed: 1947857 (15582856 kb)
> Free: 7 ( 56 kb)
> Standby: 14983 (119864 kb)
> Modified: 145 ( 1160 kb)
> ModifiedNoWrite: 0 ( 0 kb)
> Active/Valid: 133200 (1065600 kb)
> Transition: 9 ( 72 kb)
> Unknown: 0 ( 0 kb)
> TOTAL: 2096201 (16769608 kb)
> Building kernel map
> Finished building kernel map
>
> On Apr 12, 2005 6:35 PM, Graham, Simon wrote:
> > !memusage is another command that is useful in these circumstances – it
> > will summarize physical page usage (and I would guess you have a lot of
> > modified pages or possibly even mod-nowrite pages if there is a bug in
> your
> > driver) as opposed to virtual usage that !vm shows.
> >
> > /simgr
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Anees M
> > Sent: Tuesday, April 12, 2005 1:16 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Physical memory usage
> >
> > Don/Mats,
> >
> > Thanx for your answers, I agree that i have a bug in my code which
> > doesn’t handle allocation failures properly, but i am sure my driver
> > is not leaking memory. What I am rather interested in is to know why
> > there is a physical memory extensive usage even though the paged/non
> > paged pool usage , PTE usage etc displayed by the !vm extension is no
> > where near the maximum limits.
> >
> > Thanks again,
> > Anees
> >
> > On Apr 11, 2005 7:14 PM, Don Burn wrote:
> > > Actaully, the more generic answer is that since your driver crashes
due
> to
> > a
> > > memory allocation failure, you have a bug in your driver.
> > >
> > > –
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > “Mats PETERSSON” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The generic answer to large memory usage would be that some process
is
> > > > hogging or leaking memory. Which of the two is hard to say without
> > knowing
> > > > much more about what’s going on in the system… One suspect for this
> is
> > > > obviously your driver, either directly (you allocate memory without
> > regard
> > > > to others or loosing track of it) or indirectly (you make calls to
> some
> > > > system component that causes it to allocate memory on your behalf,
and
> > > > then
> > > > don’t free up the resource).
> > > >
> > > > But that’s obviously pure speculation, and there may be all sorts of
> > other
> > > > causes/reasons for this behaviour.
> > > >
> > > > –
> > > > Mats
> > > >
> > > >
> > > > xxxxx@lists.osr.com wrote on 04/11/2005 02:11:43 PM:
> > > >
> > > >> Hello all,
> > > >> On an IA 64 box with Windows 2003 and service pack1 I am seeing
> > > >> allocation calls from my driver failing and there by causing a
crash.
> > > >> If I analyze the memory usage from the crash using !vm I see
> extensive
> > > >> physical memory usage,but the rest of the info seems normal. In all
> > > >> the scenarios of low memory that I have seen earlier, I used to see
> > > >> extensive paged pool usage or PTE exhaustion which leads to these
> type
> > > >> of issues. I know how to fix/prevent the crash from my driver, but
> > > >> was more interested in knowing what exactly would lead to the
> > > >> extensive physical memory usage. Any hints ?
> > > >>
> > > >> I have pasted the !vm o/p below
> > > >>
> > > >> 0: kd> !vm
> > > >>
> > > >> Virtual Memory Usage
> > > >> Physical Memory: 2096201 (16769608 Kb)
> > > >> Page File: ??\C:\pagefile.sys
> > > >> Current: 2095104Kb Free Space: 2087040Kb
> > > >> Minimum: 2095104Kb Maximum: 4190208Kb
> > > >> Available Pages: 1962847 (15702776 Kb)
> > > >> ResAvail Pages: 145 ( 1160 Kb)
> > > >>
> > > >> Running out of physical memory
> > > >>
> > > >> Locked IO Pages: 154 ( 1232 Kb)
> > > >> Free System PTEs: 16764123 (134112984 Kb)
> > > >> Free NP PTEs: 817150 ( 6537200 Kb)
> > > >> Free Special NP: 0 ( 0 Kb)
> > > >> Modified Pages: 145 ( 1160 Kb)
> > > >> Modified PF Pages: 121 ( 968 Kb)
> > > >> NonPagedPool Usage: 4497 ( 35976 Kb)
> > > >> NonPagedPool Max: 834559 ( 6676472 Kb)
> > > >> PagedPool 0 Usage: 1348 ( 10784 Kb)
> > > >> PagedPool 1 Usage: 118 ( 944 Kb)
> > > >> PagedPool 2 Usage: 120 ( 960 Kb)
> > > >> PagedPool 3 Usage: 116 ( 928 Kb)
> > > >> PagedPool 4 Usage: 114 ( 912 Kb)
> > > >> PagedPool Usage: 1816 ( 14528 Kb)
> > > >> PagedPool Maximum: 3338240 (26705920 Kb)
> > > >> Shared Commit: 1472 ( 11776 Kb)
> > > >> Special Pool: 0 ( 0 Kb)
> > > >> Shared Process: 2900 ( 23200 Kb)
> > > >> PagedPool Commit: 1816 ( 14528 Kb)
> > > >> Driver Commit: 1978 ( 15824 Kb)
> > > >> Committed pages: 81551 ( 652408 Kb)
> > > >> Commit limit: 2302966 (18423728 Kb)
> > > >>
> > > >> Total Private: 69449 ( 555592 Kb)
> > > >>
> > > >>
> > > >> Thanks in advance
> > > >> Anees
> > > >>
> > > >> —
> > > >> Questions? First check the Kernel Driver FAQ at http://www.
> > > >> osronline.com/article.cfm?id=256
> > > >>
> > > >> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > > >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > > >> ForwardSourceID:NT000107B6
> > > >
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@gmail.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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