I call ExAllocatePoolWithTag twice in a row to allocate some data structures
from Paged Pool. The allocation sizes are approximately 800 bytes and 6
Kbytes respectively. The issue is that the second allocation always fails
with STATUS_INSUFFICIENT_RESOURCES (regardless of the order of the
allocations). That is unless I am stepping through the code in WinDbg, in
which case both allocations succeed! I can not consolidate the memory into
one call to ExAllocatePoolWithTag because the data is freed at different
times (The sizes vary also but are approximately in the same ranges). The
large buffer is used just within the function call, while the small buffer
is stored in my device extension. The small buffer is only accessed by a
system thread running at PASSIVE_LEVEL so PagedPool is appropriate. I only
need one of each at a time, so look-a-side list are not necessary.
Can anyone offer insight to this behavior?
Thanks,
Jon
A 6KB allocation is not large at all, especially for pagedpool, and should
hardly ever fail. Something else is going on here. You’ve either got a
coding error of some sort or you have left out some critical detail that
would explain your reported observations.
=====================
Mark Roddy
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jon Anglin
Sent: Monday, November 22, 2004 1:55 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] ExAllocatePoolWithTag - strange behaviour
I call ExAllocatePoolWithTag twice in a row to allocate some data structures
from Paged Pool. The allocation sizes are approximately 800 bytes and 6
Kbytes respectively. The issue is that the second allocation always fails
with STATUS_INSUFFICIENT_RESOURCES (regardless of the order of the
allocations). That is unless I am stepping through the code in WinDbg, in
which case both allocations succeed! I can not consolidate the memory into
one call to ExAllocatePoolWithTag because the data is freed at different
times (The sizes vary also but are approximately in the same ranges). The
large buffer is used just within the function call, while the small buffer
is stored in my device extension. The small buffer is only accessed by a
system thread running at PASSIVE_LEVEL so PagedPool is appropriate. I only
need one of each at a time, so look-a-side list are not necessary.
Can anyone offer insight to this behavior?
Thanks,
Jon
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’d also point out that you’re fragmenting memory with such an
architecture if this function is called at all often. Better to use a
lookaside list or otherwise pre-allocate an appropriate number of 6K
chunks and parcel them out as needed.
Roddy, Mark wrote:
A 6KB allocation is not large at all, especially for pagedpool, and should
hardly ever fail. Something else is going on here. You’ve either got a
coding error of some sort or you have left out some critical detail that
would explain your reported observations.
=====================
Mark Roddy
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jon Anglin
Sent: Monday, November 22, 2004 1:55 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] ExAllocatePoolWithTag - strange behaviour
I call ExAllocatePoolWithTag twice in a row to allocate some data structures
from Paged Pool. The allocation sizes are approximately 800 bytes and 6
Kbytes respectively. The issue is that the second allocation always fails
with STATUS_INSUFFICIENT_RESOURCES (regardless of the order of the
allocations). That is unless I am stepping through the code in WinDbg, in
which case both allocations succeed! I can not consolidate the memory into
one call to ExAllocatePoolWithTag because the data is freed at different
times (The sizes vary also but are approximately in the same ranges). The
large buffer is used just within the function call, while the small buffer
is stored in my device extension. The small buffer is only accessed by a
system thread running at PASSIVE_LEVEL so PagedPool is appropriate. I only
need one of each at a time, so look-a-side list are not necessary.
Can anyone offer insight to this behavior?
Thanks,
Jon
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
–
…/ray..
Please remove “.spamblock” from my email address if you need to contact
me outside the newsgroup.