The System Registry
contains several settings which allow you to further
configure memory management features in Windows XP. Used
properly this can further improve your PCs memory
subsystem’s performance. To access these click on Start,
Run. Type in regedit and click Ok.
Navigate to
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory
Management].
The options we are
interested in are in the right hand pane. To edit any
entry simply double click on it or right click
on the entry and select Modify. In the parenthesis
I’ll cover which format the Data is to be changed in.
The more relevant options are as follows:
ClearPageFileAtShutdown. (Hexadecimal
or Decimal). This setting allows inactive Pages in
the Paging File to be cleared (Wrote with 0s) during
shutdown. It’s certainly worth considering if you’re highly
security conscious. When set to 0 (Default)
inactive Pages are not written with 0s; having no effect on
shutdown time and making Page File data readable (this is
recommended and certainly safe for home users). A value of
1enables inactive Pages to be cleared during
shutdown, which is useful from a security viewpoint,
although shutdown times will be increased; this is
more appropriate in a business environment.
DisablePagingExecutive. (Hexadecimal
or Decimal). This setting controls how inactive
kernel-mode Drivers and system code are handled by the
memory subsystem. A value of 0 (Default)
specifies that inactive kernel-mode Drivers and system code
can be released from RAM and paged to the Page File, this is
perfectly fine on systems with lower amounts of RAM
installed and with 512MB or less is recommended. A value of
1 specifies that inactive kernel-mode Drivers and
system code are held in RAM; this provides enhanced
performance on systems with a large amount of RAM as such
data can be accessed significantly faster when held in RAM
than having to be read from the Page File. Given the higher
system requirements of Applications nowadays (especially
games) you should only consider using this with
greater than 512MB RAM installed.
IoPageLockLimit.
This setting specifies the limit of the number of bytes that
can be locked for I/O operations. Depending on the version
of XP you have installed (Gold, Service Pack 1 or 2) this
option may not appear. Regardless of whether it’s listed or
not it’s an obsolete option which has no effect. While some
suggest you may set this manually regardless, it’s
completely unnecessary. Don’t adjust this value if it’s
listed, and certainly don’t create an entry for it if it’s
not.
LargeSystemCache.
(Hexadecimal or Decimal). This setting
controls the size of the file system cache. When set to 0
(Default) a standard sized file system cache is
allocated (Less than 10MB RAM); this is recommended as it
provides best Application performance. When set to 1
this enables the use of a large file system cache (Up
to RAM minus 4MB!); this option is only suitable when
Windows XP is acting as a Server not as a gaming
system or for other Application/Workstation use as it will
be detrimental to performance as Microsoft notes:
When you enable
System cache mode on a computer that uses Unified Memory
Architecture-based video hardware or AGP, you may experience
a severe and random decrease in performance. The Drivers for
these components consume a large part of the remaining
application memory when they are initialized during startup.
Note – This is the
same as the Memory usage option in the Performance
Options, Advanced tab.
PagingFiles.
This option specifies the location, file name and size of
the Page File(s) for the system, for example:
C:\pagefile.sys 3 3
D:\pagefile.sys 450
750
Note – This is the
similar to the Virtual Memory options window,
accessible in the Performance Options, Advanced
tab, pressing the Change button. The main point of
potential interest with this option is that it allows you to
rename the Page File, which might be of interest to a
few people out there.
SecondLevelDataCache. This
setting specifies the L2 Cache size of your CPU (Defaulting
to 256K when unable to determine) and it’s only
appropriate to specify a value with CPUs with off-die L2
Cache (i.e. Pre-Pentium 2, in which case - update your
hardware!). With any remotely modern CPU Windows accurately
queries this value via the Hardware Abstraction Layer and as
such there’s no need to adjust this option. While some
suggest you may set this manually regardless; it’s
completely unnecessary. Leave this set to 0.
Other options
listed, e.g. NonPagedPoolSize, can be ignored and are
likely at their default of 0; indicating they
are calculated automatically based on system configuration,
e.g. RAM installed.
Now navigate to the
PrefetchParameters subfolder ([HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Memory Management\PrefetchParameters]).
EnablePrefetcher.
Prefetching is the process of tracing and recording page
faults during boot/Application loads. This info is used
subsequently to prefetch pages from disk to avoid page
faults during boot. As device drivers are loaded, services
started, and so on, then pages will be needed from the disk
drive. Prefetching these pages means reading ahead before
the pages are needed so that they are already in memory
thereby eliminating disk I/O delays; providing improved
boot/Application startup times. This is further enhanced by
auto-defragmentation which moves this layout data to a
contiguous (unfragmented) block. Prefetching is monitored
continually, so the layout changes as your usage pattern
does. This setting determines how XP’s Prefetching feature
functions. 4 options are available:
0.
Selecting this option sets that Prefetching is disabled.
This makes XP function similar to earlier versions of
Windows when booting/launching Applications, i.e. it’s
slower. There’s no particularly good reason to select this.
1.
Selecting this option enables prefetching of
Applications only. During system boot only pages relating to
Applications will be fetched. This isn’t particularly
recommended as it increases boot time for no real
reason.
2.
Selecting this option enables boot prefetching.
During system boot only pages relating to booting up are
fetched, reducing boot times, although launches of regularly
used Applications after startup make take longer
unnecessarily. This is of some use when the system is acting
as a Server as Applications won’t be a concern.
3.
Selecting this option enables boot and Application
prefetching. During system boot pages relating to both boot
and Applications are fetched, which provides improved boot
times and faster Application initialisations. This is highly
recommended.
Some have suggested
setting this to other values; such as 5. This is pointless
however; they aren’t even valid values, only 0-3 are.
Further technical info on Prefetching can be found at
Microsoft
here
and
here.
Note – The Task
Scheduler service needs to be set to Automatic
for Prefetching to function correctly. Additionally there is
no need to periodically clear the Prefetch directory
for the reasons stated above, while using the /Prefetch
command for launching Applications has
no
beneficial affect either.
EnableSuperfetch.
This setting appeared thanks to an article by The Inquirer,
claiming it provided XP with Windows Vista like performance.
Unsurprisingly enough, it’s not even a supported setting in
XP and if you happened to create this entry right click
and Delete it.
Now navigate to the
SubSystems subfolder ([HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Memory Management\SubSystems]). It’s been
recommended to remove support for POSIX (Portable Operating
System Interface), as it yields a negligible reduction in
memory requirements. However, this is not necessary as
POSIX Support isn’t available by default in
Windows XP.
Now navigate to
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer].
There may be a sub-key listed in the left hand pane
entitled AlwaysUnloadDLL, with (Default) set
to 1 in the right hand pane. Some recommend
setting this as it frees unused DLLs (Dynamic
Link Library) from memory quicker. This
actually only applies to Windows Explorer extensions (As the
Registry location hints) and as
Microsoft
notes:
The Shell
automatically unloads a DLL when its usage count is zero,
but only after the DLL has not been used for a period of
time. This inactive period might be unacceptably long at
times, especially when a Shell extension DLL is being
debugged. For operating systems prior to Windows 2000,
you can shorten the inactive period by adding the following
information to the registry.
Essentially, if
you’ve got this sub-key listed right click on it (AlwaysUnloadDLL)
and Delete it; it’s completely unnecessary.