User-mode and kernel-mode drivers and kernel-mode system code can be written to be either pageable or non-pageable. Pageable means that the Windows operating system can page or flush the driver or system code to disk when not in use in order to free up the memory for other processes.

For system with large amount of RAM memory size, it’s possible to boost system performance and increase system speed by forcing and keeping the pagable system code and driver in physical memory, even if they’re programed as can page to disk. By keeping the code bits to stay loaded in memory, the OS can immediately access the driver or system code whenever required without the need to swap and read from hard disk again, which is slower.

If your system has enough physical RAM memory, you can force Windows OS to keep pageable drivers and system codes in memory. To check if your system has enough memory to perform this tweak, a good indicator is to load all applications intended to be use simultaneously, and then run Task Manager (Taskmgr). Go to the Performance tab to look at the amount of physical RAM, which should be greater than the Peak Commit Charge by at least 16MB (only in Windows XP). Generally speaking, if total RAM size of the system is greater than 512 MB, the trick is workable.

To enable pageable not swap to disk feature (or more appropriately disable the paging feature), just tweak the DisablePagingExecutive registry key located in the following registry hive:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management

The default value for DisablePagingExecutive is 0, which make OS adheres to developer’s intent on paging ability. Setting the DisablePagingExecutive registry value to 1 will disable paging ability and make all user-mode and kernel-mode drivers or kernel-mode system code to remain running in memory without swapping to disk.

If you are worry that the system will take out too large amount of RAM to keep the not paged data, it’s possible to set the limit for the maximum amount of memory can be used to store non-paged data in memory. To do so, change the NonPagedPoolSize registry key in the same registry branch:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

The value are in byte. So to set the limit of which Windows can keep non-paged memory limit to 128 MB, set the value of NonPagedPoolSize value to 134217728 in decimal or 0x8000000 in hexadecimal. By default, the value is 0 (zero), which mean let system decide. To ensure that the system doesn’t override the NonPagedPoolSize settings, also set the corresponding value to NonPagedPoolQuota, which will be respected no matter what’s going on (good or bad) on the system. (Alternatively, just leave the NonPagedPoolSize value at default 0 and only change the NonPagedPoolQuota, since this is where the system usually gets really conservative since it doesn’t know the usage patterns.)

However, before changing NonPagedPoolSize and NonPagedPoolQuota values, do make sure that the system has enough memory for other processors and usages, as non-paged memory block will be set aside and reserved no matter whether system use it or not, else the tweak will achieve the unintended effect of making system slower instead of faster.

The tweak works on most Windows such as Windows Vista and Windows XP.