Low Pool Memory and Windows XPUpdated: December 4, 2001
When the system is low on pool memory, calling ExAllocatePool with the pool type NonPagedPoolMustSucceed will cause the system to crash. This can occur, for example, on a web server where client spikes are frequent and short, but the occurrences use a great deal of pool memory and can cause memory to become fragmented temporarily. Early in development of Microsoft Windows 2000, and again for Windows XP, the Windows development team purged NonPagedPoolMustSucceed references from the kernel and from all built-in drivers. Testing at Microsoft shows that a number of driver regressions are using the NonPagedPoolMustSucceed flag to allocate pool memory. Some of these references are in existing drivers and some are in new drivers. The presence of this flag in your driver means that whenever the system is low on non-paged pool, your driver can crash the system. Because ExAllocatePool with the NonPagedPoolMustSucceed flag can cause a bugcheck, drivers should not use this flag. Instead, drivers should allocate non-paged memory with the NonPagedPool or NonPagedPoolCacheAligned flags and, if ExAllocatePool returns NULL, return the NTSTATUS value STATUS_INSUFFICIENT_RESOURCES. Also, to maximize system performance, drivers should use paged memory instead of non-paged memory whenever it is safe to do so. Drivers must also use MmGetSystemAddressForMdlSafe instead of MmGetSystemAddressForMdl to allocate system address mappings for memory descriptor lists (MDLs), because MmGetSystemAddressForMdl can cause a bugcheck if the system is temporarily low on MDLs. For the past year, the Driver Verifier has flagged any pool allocation specified as NonPagedPoolMustSucceed as fatal, and it has bugchecked these systems. Driver writers are strongly encouraged to test their drivers with Driver Verifier as described in the Windows Driver Development Kit (DDK) and remove all occurrences of NonPagedPoolMustSucceed and unsafe allocations of MDLs. Call to Action
|
|
