Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


a Query!

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hi all,

Is there any limit on the total Kernel memory Usage in NT 4.0 (i am using
the NT TaskManager to look at the total kernel memory)
if so, could somebody pass me the info.


thanks,
KIRAN MANDAVA,
Software Engineer.
SkyStream Networks
"Building the Broadcast Internet"

Comments

  • OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
    As you've discovered, there's a limit on the number of system PTEs used
    for mapping physical memory to system-space virtual addresses. Paged
    and nonpaged pools, plus any user buffers you lock and map, all consume
    these PTEs. So yes, there is an effective limit.

    There is a registry entry you can make to increase the number of system
    PTEs allocated, but there is a ceiling on how high you can increase this.
    It is entirely conceivable for you to have more physical memory than can
    be mapped into system space. When I had a NO_MORE_SYSTEM_PTEs blue-screen,
    I eventually learned that increasing the number of PTEs was not the
    solution to my problem. I had to stop mapping I/O buffers into system
    space at all, instead rearchitecting my drivers to work with MDLs.

    The problem can be exacerbated by odd application behavior, specifically
    using the same buffer in several outstanding I/Os. For example, imagine
    an application that does an overlapped write from the same 20 MB buffer
    to each of 16 different devices. If you map each incoming user buffer
    into system space, you've burned 320 MB worth of system PTEs (81920), well
    above the default number available (10000) or the maximum (50000). If you
    were able to recognize that it was the same buffer, you could get by with
    a single system-space mapping, consuming 5120 PTEs. If you work with
    MDLs, you don't consume any system PTEs.

    If you've got a driver that needs to look at or modify the data, such
    as compression or encryption, and if you are in fact the party doing
    the mapping, then you'll have to come up with some sort of throttle
    on the amount of memory you map at any given time.

    MmProbeAndLockPages() shouldn't consume PTEs, but MmMapLockedPages()
    does. Note that MmGetSystemAddressForMdl() can call MmMapLockedPages().
    When you're done with a mapping, be sure to call MmUnmapLockedPages().

    -----------------------------------------------------------------------
    Dave Cox
    Hewlett-Packard Co.
    HPSO/SSMO (Santa Barbara)
    https://ecardfile.com/id/Dave+Cox


    -----Original Message-----
    From: Kiran Mandava [mailto:[email protected]]
    Sent: Tuesday, April 11, 2000 5:41 PM
    To: NT Developers Interest List
    Subject: [ntdev] a Query!


    Hi all,

    Is there any limit on the total Kernel memory Usage in NT 4.0 (i am using
    the NT TaskManager to look at the total kernel memory)
    if so, could somebody pass me the info.


    thanks,
    KIRAN MANDAVA,
    Software Engineer.
    SkyStream Networks
    "Building the Broadcast Internet"


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hi all,


    What happens if i build two MDLs describing the same NonPagedPoolbuffer and
    do some operations like mmprobeandlockpages and mmunlockpages on one of the
    MDL...



    KIRAN MANDAVA,
    SkyStream Networks
    "Building the Broadcast Internet"
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 16-20 October 2023 Live, Online
Developing Minifilters 13-17 November 2023 Live, Online
Internals & Software Drivers 4-8 Dec 2023 Live, Online
Writing WDF Drivers 10-14 July 2023 Live, Online