Large (locked) buffer

What is the best way to maximize the amount of locked RAM? A client needs to
have as large a buffer as possible in memory and not paged out. Microsoft
has told me that, e.g., on a 1 GB system we can only hope to lock around
250-300 MBs. Can anyone confirm/rebut this?

Bill Casey

== SCSI Adapters & VirtualSCSI Target Mode Libs ==
Advanced Storage Concepts, Inc. (409) 744-2129
2720 Terminal Drive xxxxx@virtualscsi.com
Galveston, TX 77554 USA www.virtualscsi.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

If you use MmProbeAndLockPages to lock down the memory, you aren’t going to
get more than about a quarter of the memory in the machine. – if you set a
data bp on NT!MmLockPagesLimit when booting, you’ll see that it gets set to
the number of phyiscal pages in the machine / 4.

The best way I’ve found to lock down more is to use the AWE apis… but
these are only available in usermode, unfortunately. The APIs were designed
to let apps take advantage of systems with > 4gb of ram but will work on
any Win2k-or-newer system. You can use a usermode service tied to the
driver that will do the AWE (AllocateUserPhysicalPages) allocations for you
and pass the physical addresses down to the driver in an ioctl or other
interface of your own devising.

The driver can then map the portions it needs into memory and then unmap
when it is done … if you try to map the whole thing you are going to be
taking up precious system address space (especially on a system booted with
the /3gb switch). Note that abuse of the AWE apis can cause the system to
become low on resources and AWE memory does not count towards process quota
limits (AFAIK).

Alternately you can munge the size of the nonpagedpool in the registry but
IMO you shouldn’t really be fiddling with things like that in production
code. I even saw someone get around this problem by patching the
MmLockedPagesLimit.

Hope this was helpful.
-jordan

On 04/30/01, ““Bill Casey” ” wrote:
> What is the best way to maximize the amount of locked RAM? A client needs to
> have as large a buffer as possible in memory and not paged out. Microsoft
> has told me that, e.g., on a 1 GB system we can only hope to lock around
> 250-300 MBs. Can anyone confirm/rebut this?
>
> Bill Casey
>
> == SCSI Adapters & VirtualSCSI Target Mode Libs ==
> Advanced Storage Concepts, Inc. (409) 744-2129
> 2720 Terminal Drive xxxxx@virtualscsi.com
> Galveston, TX 77554 USA www.virtualscsi.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com