Allocate more than 100MB

I’ve written a RAM Disk Driver. This driver allocates the Non-Paged-Pool
memory for the RAM Disk with ExAllocatePool. Some users reported, that the
RAM Disk does not work, if it is configured to use more than 100MB. Some
users have up to 1GB RAM installed, but the allocations also fails. Can
anyone expain why ExAllocatePool fails ? Is there an alternativ for
ExAllocatePool to get NonPagedPool memory ?

A. Roth


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

The NPP size is limited.
See the MS’s technotes for limit values.

Max

----- Original Message -----
From: “Andreas Roth”
To: “NT Developers Interest List”
Sent: Thursday, January 17, 2002 6:54 PM
Subject: [ntdev] Allocate more than 100MB

> I’ve written a RAM Disk Driver. This driver allocates the Non-Paged-Pool
> memory for the RAM Disk with ExAllocatePool. Some users reported, that the
> RAM Disk does not work, if it is configured to use more than 100MB. Some
> users have up to 1GB RAM installed, but the allocations also fails. Can
> anyone expain why ExAllocatePool fails ? Is there an alternativ for
> ExAllocatePool to get NonPagedPool memory ?
>
> A. Roth
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Just want to mention that an example maximum Non-Paged-Pool size on Windows
2000 is limited by 256Mb (128Mb if system loaded with /3GB). If you don’t
set proprietary registry key manually, system calculates the size of
Non-Paged-Pool basing on amount of avalable system memory, so it’s usually
even less. So there is no wonder that allocation of such amount of memory
fails.

BR,
Vadim
http://www.ntndis.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Andreas Roth
Sent: Thursday, January 17, 2002 6:55 PM
To: NT Developers Interest List
Subject: [ntdev] Allocate more than 100MB

I’ve written a RAM Disk Driver. This driver allocates the Non-Paged-Pool
memory for the RAM Disk with ExAllocatePool. Some users reported, that the
RAM Disk does not work, if it is configured to use more than 100MB. Some
users have up to 1GB RAM installed, but the allocations also fails. Can
anyone expain why ExAllocatePool fails ? Is there an alternativ for
ExAllocatePool to get NonPagedPool memory ?

A. Roth


You are currently subscribed to ntdev as: xxxxx@pcausa.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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 don’t set proprietary registry key manually, system calculates the
size of
Non-Paged-Pool basing on amount of avalable system memory, so it’s usually
even less.”

On machines with 1GB, the system ‘should’ - (I didn’t actually do the calc)
calculate the size of NPaged Pool to be 256MB. A rough calculation can be
found in the MS Knowledgebase - Q126402. I do not recommend playing with
the registry entry. Also, do not use up the entire 256MB or else
MUST_SUCCEED calls with fail.

“Is there an alternativ for ExAllocatePool to get NonPagedPool memory?”

Depends on what you need the memory for.

Jason


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

BUT … rerquesting memory from NPP is subject to availability, and
requesting 100MB of NPP may not be available, if it is requested as
contiguous. Fragmentation may cause a memory request to be refused, even
though available memory exceeds the request. That explains why sometimes
he/she/it gets it and sometimes they don’t.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Jason LaVoie [mailto:lavoie@us.ibm.com]
Sent: Thursday, January 17, 2002 9:24 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

“If you don’t set proprietary registry key manually, system calculates the
size of
Non-Paged-Pool basing on amount of avalable system memory, so it’s usually
even less.”

On machines with 1GB, the system ‘should’ - (I didn’t actually do the calc)
calculate the size of NPaged Pool to be 256MB. A rough calculation can be
found in the MS Knowledgebase - Q126402. I do not recommend playing with
the registry entry. Also, do not use up the entire 256MB or else
MUST_SUCCEED calls with fail.

“Is there an alternativ for ExAllocatePool to get NonPagedPool memory?”

Depends on what you need the memory for.

Jason


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

I need a replacement for ExAllocatePool. The memory is needed for a RAM
Disk. So any suggestions are welcomed !

A. Roth

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Gary Little
Sent: Donnerstag, 17. Januar 2002 18:44
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

BUT … rerquesting memory from NPP is subject to availability, and
requesting 100MB of NPP may not be available, if it is requested as
contiguous. Fragmentation may cause a memory request to be refused, even
though available memory exceeds the request. That explains why sometimes
he/she/it gets it and sometimes they don’t.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Jason LaVoie [mailto:lavoie@us.ibm.com]
Sent: Thursday, January 17, 2002 9:24 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

“If you don’t set proprietary registry key manually, system calculates the
size of
Non-Paged-Pool basing on amount of avalable system memory, so it’s usually
even less.”

On machines with 1GB, the system ‘should’ - (I didn’t actually do the calc)
calculate the size of NPaged Pool to be 256MB. A rough calculation can be
found in the MS Knowledgebase - Q126402. I do not recommend playing with
the registry entry. Also, do not use up the entire 256MB or else
MUST_SUCCEED calls with fail.

“Is there an alternativ for ExAllocatePool to get NonPagedPool memory?”

Depends on what you need the memory for.

Jason


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


You are currently subscribed to ntdev as: xxxxx@arsoft-online.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Allocate the memory VERY early during system initialization. If
fragmentation is not a problem then ExAlloc… if fine, but if you need
contiguous memory then you need to use a DMA adapter object and allocate
contiguous memory. Once you have, do not release it. Piggish I know, but
there is no guarantee you will get it the second time.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Andreas Roth [mailto:xxxxx@arsoft-online.de]
Sent: Thursday, January 17, 2002 11:36 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

I need a replacement for ExAllocatePool. The memory is needed for a RAM
Disk. So any suggestions are welcomed !

A. Roth

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Gary Little
Sent: Donnerstag, 17. Januar 2002 18:44
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

BUT … rerquesting memory from NPP is subject to availability, and
requesting 100MB of NPP may not be available, if it is requested as
contiguous. Fragmentation may cause a memory request to be refused, even
though available memory exceeds the request. That explains why sometimes
he/she/it gets it and sometimes they don’t.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Jason LaVoie [mailto:lavoie@us.ibm.com]
Sent: Thursday, January 17, 2002 9:24 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

“If you don’t set proprietary registry key manually, system calculates the
size of
Non-Paged-Pool basing on amount of avalable system memory, so it’s usually
even less.”

On machines with 1GB, the system ‘should’ - (I didn’t actually do the calc)
calculate the size of NPaged Pool to be 256MB. A rough calculation can be
found in the MS Knowledgebase - Q126402. I do not recommend playing with
the registry entry. Also, do not use up the entire 256MB or else
MUST_SUCCEED calls with fail.

“Is there an alternativ for ExAllocatePool to get NonPagedPool memory?”

Depends on what you need the memory for.

Jason


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


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


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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 don’t care about physical address of every single page
then you can use ExAllocatePool(PagedPool, ) and
MmProbeAndLockPages() to make the whole buffer
(or its part) resident.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Andreas Roth
Sent: Thursday, January 17, 2002 8:36 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

I need a replacement for ExAllocatePool. The memory is needed for a RAM
Disk. So any suggestions are welcomed !

A. Roth

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Gary Little
Sent: Donnerstag, 17. Januar 2002 18:44
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

BUT … rerquesting memory from NPP is subject to availability, and
requesting 100MB of NPP may not be available, if it is requested as
contiguous. Fragmentation may cause a memory request to be refused, even
though available memory exceeds the request. That explains why sometimes
he/she/it gets it and sometimes they don’t.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Jason LaVoie [mailto:lavoie@us.ibm.com]
Sent: Thursday, January 17, 2002 9:24 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Allocate more than 100MB

“If you don’t set proprietary registry key manually, system calculates the
size of
Non-Paged-Pool basing on amount of avalable system memory, so it’s usually
even less.”

On machines with 1GB, the system ‘should’ - (I didn’t actually do the calc)
calculate the size of NPaged Pool to be 256MB. A rough calculation can be
found in the MS Knowledgebase - Q126402. I do not recommend playing with
the registry entry. Also, do not use up the entire 256MB or else
MUST_SUCCEED calls with fail.

“Is there an alternativ for ExAllocatePool to get NonPagedPool memory?”

Depends on what you need the memory for.

Jason


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


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


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

In addition, for RAM disk purposes paged pool should be sufficient without
locking pages. It would probably need more complicated driver design (queue
requests and process them in worker thread at PASSIVE_LEVEL, maybe need to
use several smaller pieces of memory).

Just interested: why do you need a RAM disk?

P.S. To Paul: do you have any special reason for using HTML mails? :wink:

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


If you don’t care about physical address of every single page
then you can use ExAllocatePool(PagedPool, ) and
MmProbeAndLockPages() to make the whole buffer
(or its part) resident.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com [
mailto:xxxxx]On Behalf Of Andreas Roth
> Sent: Thursday, January 17, 2002 8:36 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Allocate more than 100MB
>
>
> I need a replacement for ExAllocatePool. The memory is needed for a RAM
> Disk. So any suggestions are welcomed !
>
> A. Roth
>
>


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</mailto:xxxxx>

Hi,

Can you allocate memory and then just lock it? If you want to access the
memory at elevated IRQL…

BTW, as requests to read & write the “media” comes at PASSIVE_LEVEL maybe
you’d just allocate paged memory? Then size of your RAM disk will be
limited with the size of page file I think.

Regards,
Anton

I’ve written a RAM Disk Driver. This driver allocates the Non-Paged-Pool
memory for the RAM Disk with ExAllocatePool. Some users reported, that the
RAM Disk does not work, if it is configured to use more than 100MB. Some
users have up to 1GB RAM installed, but the allocations also fails. Can
anyone expain why ExAllocatePool fails ? Is there an alternativ for
ExAllocatePool to get NonPagedPool memory ?

A. Roth


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


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

Doesn’t using the pagefile as a RAM disk sort of defeat the purpose of a
RAM disk?

“Anton Kolomyeytsev” @lists.osr.com on 01/17/2002
08:52:56 AM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: Allocate more than 100MB

Hi,

Can you allocate memory and then just lock it? If you want to access the
memory at elevated IRQL…

BTW, as requests to read & write the “media” comes at PASSIVE_LEVEL maybe
you’d just allocate paged memory? Then size of your RAM disk will be
limited with the size of page file I think.

Regards,
Anton

> I’ve written a RAM Disk Driver. This driver allocates the Non-Paged-Pool
> memory for the RAM Disk with ExAllocatePool. Some users reported, that
the
> RAM Disk does not work, if it is configured to use more than 100MB. Some
> users have up to 1GB RAM installed, but the allocations also fails. Can
> anyone expain why ExAllocatePool fails ? Is there an alternativ for
> ExAllocatePool to get NonPagedPool memory ?
>
> A. Roth
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@seagate.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Well yeah, but it solves the allocation problem :slight_smile:

-----Original Message-----
From: xxxxx@seagate.com
[mailto:xxxxx@seagate.com]
Sent: Thursday, January 17, 2002 4:23 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Allocate more than 100MB

Doesn’t using the pagefile as a RAM disk sort of defeat the
purpose of a RAM disk?

“Anton Kolomyeytsev” @lists.osr.com on
> 01/17/2002 08:52:56 AM
>
> Please respond to “NT Developers Interest List”
>
> Sent by: xxxxx@lists.osr.com
>
>
> To: “NT Developers Interest List”
> cc:
>
> Subject: [ntdev] Re: Allocate more than 100MB
>
>
> Hi,
>
> Can you allocate memory and then just lock it? If you want to
> access the memory at elevated IRQL…
>
> BTW, as requests to read & write the “media” comes at
> PASSIVE_LEVEL maybe you’d just allocate paged memory? Then
> size of your RAM disk will be limited with the size of page
> file I think.
>
> Regards,
> Anton
>
> > I’ve written a RAM Disk Driver. This driver allocates the
> > Non-Paged-Pool memory for the RAM Disk with ExAllocatePool.
> Some users
> > reported, that
> the
> > RAM Disk does not work, if it is configured to use more than 100MB.
> > Some users have up to 1GB RAM installed, but the allocations also
> > fails. Can anyone expain why ExAllocatePool fails ? Is there an
> > alternativ for ExAllocatePool to get NonPagedPool memory ?
> >
> > A. Roth
> >
> >
> > —
> > You are currently subscribed to ntdev as:
> xxxxx@seagate.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@seagate.com To unsubscribe send a blank email
> to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Does’t using large amount of physical memory stolen from NT Cache and
Memory Manager defeat the purpose of using whole system? -)

On 01/17/02, “xxxxx@seagate.com” wrote:

Doesn’t using the pagefile as a RAM disk sort of defeat the purpose of a
RAM disk?

“Anton Kolomyeytsev” @lists.osr.com on 01/17/2002
> 08:52:56 AM
>
> Please respond to “NT Developers Interest List”
>
> Sent by: xxxxx@lists.osr.com
>
>
> To: “NT Developers Interest List”
> cc:
>
> Subject: [ntdev] Re: Allocate more than 100MB
>
>
> Hi,
>
> Can you allocate memory and then just lock it? If you want to access the
> memory at elevated IRQL…
>
> BTW, as requests to read & write the “media” comes at PASSIVE_LEVEL maybe
> you’d just allocate paged memory? Then size of your RAM disk will be
> limited with the size of page file I think.
>
> Regards,
> Anton
>
> > I’ve written a RAM Disk Driver. This driver allocates the Non-Paged-Pool
> > memory for the RAM Disk with ExAllocatePool. Some users reported, that
> the
> > RAM Disk does not work, if it is configured to use more than 100MB. Some
> > users have up to 1GB RAM installed, but the allocations also fails. Can
> > anyone expain why ExAllocatePool fails ? Is there an alternativ for
> > ExAllocatePool to get NonPagedPool memory ?
> >
> > A. Roth
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@seagate.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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


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

You didn’t really ask that question, did you? Are you really suggesting
that using a RAM disk can’t improve on the performance of a system with a
memory and cache manager that beheads the working set of active processes
just so it can keep more physical memory available? OK, I will admit that
Windows 2000 and XP appear to be better in this regard than Windows NT 4.0,
but they still have way too much bias toward free physical memory than
performance of pageable modules in active processes.

And no, I don’t think that using 256 MB of a 1GB system as a RAM disk is
defeating the purpose of using the whole system. I don’t use a RAM disk
myself, but I think it might be a net gain if you put a swap file in it.

Phil

“Anton Kolomyeytsev” @lists.osr.com on 01/18/2002
03:40:04 AM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: Allocate more than 100MB

Does’t using large amount of physical memory stolen from NT Cache and
Memory Manager defeat the purpose of using whole system? -)

On 01/17/02, “xxxxx@seagate.com” wrote:
> Doesn’t using the pagefile as a RAM disk sort of defeat the purpose of a
> RAM disk?
>
>
>
>
>
> “Anton Kolomyeytsev” @lists.osr.com on 01/17/2002
> 08:52:56 AM
>
> Please respond to “NT Developers Interest List”
>
> Sent by: xxxxx@lists.osr.com
>
>
> To: “NT Developers Interest List”
> cc:
>
> Subject: [ntdev] Re: Allocate more than 100MB
>
>
> Hi,
>
> Can you allocate memory and then just lock it? If you want to access the
> memory at elevated IRQL…
>
> BTW, as requests to read & write the “media” comes at PASSIVE_LEVEL maybe
> you’d just allocate paged memory? Then size of your RAM disk will be
> limited with the size of page file I think.
>
> Regards,
> Anton
>
> > I’ve written a RAM Disk Driver. This driver allocates the
Non-Paged-Pool
> > memory for the RAM Disk with ExAllocatePool. Some users reported, that
> the
> > RAM Disk does not work, if it is configured to use more than 100MB.
Some
> > users have up to 1GB RAM installed, but the allocations also fails. Can
> > anyone expain why ExAllocatePool fails ? Is there an alternativ for
> > ExAllocatePool to get NonPagedPool memory ?
> >
> > A. Roth
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@seagate.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@seagate.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Why then use a swap (page) file on such “rich memory” system?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@seagate.com
Sent: Friday, January 18, 2002 6:26 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Allocate more than 100MB

You didn’t really ask that question, did you? Are you really suggesting
that using a RAM disk can’t improve on the performance of a system with a
memory and cache manager that beheads the working set of active processes
just so it can keep more physical memory available? OK, I will admit that
Windows 2000 and XP appear to be better in this regard than Windows NT 4.0,
but they still have way too much bias toward free physical memory than
performance of pageable modules in active processes.

And no, I don’t think that using 256 MB of a 1GB system as a RAM disk is
defeating the purpose of using the whole system. I don’t use a RAM disk
myself, but I think it might be a net gain if you put a swap file in it.

Phil

“Anton Kolomyeytsev” @lists.osr.com on 01/18/2002
03:40:04 AM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: Allocate more than 100MB

Does’t using large amount of physical memory stolen from NT Cache and
Memory Manager defeat the purpose of using whole system? -)

On 01/17/02, “xxxxx@seagate.com” wrote:
> Doesn’t using the pagefile as a RAM disk sort of defeat the purpose of a
> RAM disk?
>
>
>
>
>
> “Anton Kolomyeytsev” @lists.osr.com on 01/17/2002
> 08:52:56 AM
>
> Please respond to “NT Developers Interest List”
>
> Sent by: xxxxx@lists.osr.com
>
>
> To: “NT Developers Interest List”
> cc:
>
> Subject: [ntdev] Re: Allocate more than 100MB
>
>
> Hi,
>
> Can you allocate memory and then just lock it? If you want to access the
> memory at elevated IRQL…
>
> BTW, as requests to read & write the “media” comes at PASSIVE_LEVEL maybe
> you’d just allocate paged memory? Then size of your RAM disk will be
> limited with the size of page file I think.
>
> Regards,
> Anton
>
> > I’ve written a RAM Disk Driver. This driver allocates the
Non-Paged-Pool
> > memory for the RAM Disk with ExAllocatePool. Some users reported, that
> the
> > RAM Disk does not work, if it is configured to use more than 100MB.
Some
> > users have up to 1GB RAM installed, but the allocations also fails. Can
> > anyone expain why ExAllocatePool fails ? Is there an alternativ for
> > ExAllocatePool to get NonPagedPool memory ?
> >
> > A. Roth
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@seagate.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

So you have an opportunity to catch a memory hog and kill it before it
causes a BSOD, for one. If you have a page-file that can grow, you wil=
l
see the disk thrash like a mad dog as it grows the page file. Since th=
e
only times I’ve ever had a runaway memory hog is when I’ve written the =
bug
that induced it, I was sitting at the console, and it was obvious what
happened. Stop runaway process in debugger, or just kiill it with task=

manager, and get it all back. Without expandable page file, probabilit=
y of
immediate BSOD is almost 100%.

That’s why.

Phil

“Pavel Hrdina” @lists.osr.com on 01/18/2002 10:38:1=
0 AM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: Allocate more than 100MB

Why then use a swap (page) file on such “rich memory” system?

-----Original Message-----
From: xxxxx@lists.osr.com [
mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@seagate.com
Sent: Friday, January 18, 2002 6:26 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Allocate more than 100MB

You didn’t really ask that question, did you?=A0 Are you really suggest=
ing
that using a RAM disk can’t improve on the performance of a system with=
a
memory and cache manager that beheads the working set of active process=
es
just so it can keep more physical memory available?=A0 OK, I will admit=
that
Windows 2000 and XP appear to be better in this regard than Windows NT =
4.0,
but they still have way too much bias toward free physical memory than
performance of pageable modules in active processes.

And no, I don’t think that using 256 MB of a 1GB system as a RAM disk i=
s
defeating the purpose of using the whole system.=A0 I don’t use a RAM d=
isk
myself, but I think it might be a net gain if you put a swap file in it=
.

Phil

“Anton Kolomyeytsev” @lists.osr.com on 01/18/2002
03:40:04 AM

Please respond to “NT Developers Interest List”

Sent by:=A0 xxxxx@lists.osr.com

To:=A0=A0 “NT Developers Interest List”
cc:

Subject:=A0 [ntdev] Re: Allocate more than 100MB

Does’t using large amount of physical memory stolen from NT Cache and
Memory Manager defeat the purpose of using whole system? -)

On 01/17/02, “xxxxx@seagate.com” wrote:
> Doesn’t using the pagefile as a RAM disk sort of defeat the purpose o=
f a
> RAM disk?
>
>
>
>
>
> “Anton Kolomyeytsev” @lists.osr.com on 01/17/2002
> 08:52:56 AM
>
> Please respond to “NT Developers Interest List” =

>
> Sent by:=A0 xxxxx@lists.osr.com
>
>
> To:=A0=A0 “NT Developers Interest List”
> cc:
>
> Subject:=A0 [ntdev] Re: Allocate more than 100MB
>
>
> Hi,
>
> Can you allocate memory and then just lock it? If you want to access =
the
> memory at elevated IRQL…
>
> BTW, as requests to read & write the “media” comes at PASSIVE_LEVEL m=
aybe
> you’d just allocate paged memory? Then size of your RAM disk will be
> limited with the size of page file I think.
>
> Regards,
> Anton
>
> > I’ve written a RAM Disk Driver. This driver allocates the
Non-Paged-Pool
> > memory for the RAM Disk with ExAllocatePool. Some users reported, t=
hat
> the
> > RAM Disk does not work, if it is configured to use more than 100MB.=

Some
> > users have up to 1GB RAM installed, but the allocations also fails.=
Can
> > anyone expain why ExAllocatePool fails ? Is there an alternativ for=

> > ExAllocatePool to get NonPagedPool memory ?
> >
> > A. Roth
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@seagate.c=
om
> > To unsubscribe send a blank email to xxxxx@lists.osr.co=
m
>
> —
> You are currently subscribed to ntdev as: xxxxx@seagate.com=

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

> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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


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

You are currently subscribed to ntdev as: xxxxx@seagate.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

> defeating the purpose of using the whole system. I don’t use a RAM disk

myself, but I think it might be a net gain if you put a swap file in it.

Is it possible in NT to disable all swap files at all?
If yes - this would have the same effect.

I’ve heard that NT’s MM will not allow this, since the swap file minimal size must be equal to the RAM size. Is it really so?

Max


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

Where did you get the idea that you must have a swap file at least as big
as physical memory? That’s only required if you want a complete memory
dump, and then the requirement is that you must have a page file at least
that big on your boot partition. You can have more page files than that,
of course, but that’s the minimum. If you don’t care about a complete
memory dump, you can make it smaller, but if you have a swap file, there is
a minimum size that’s clearly indicated on the system property page where
you set the page file size. On all of my systems, the minimum size is 2
MB…

You can disable swap file in it’s entirety, at least on Windows NT 4.0.
I’ve never tried to do it on Windows 2000 or Windows XP, but I doubt that
has changed. Just make sure you never run out of memory, because the MM
will immediately BSOD when it can’t satisfy a memory allocation.

Phil

“Maxim S. Shatskih” @lists.osr.com on 01/18/2002
02:59:56 PM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: Allocate more than 100MB

> defeating the purpose of using the whole system. I don’t use a RAM disk
> myself, but I think it might be a net gain if you put a swap file in it.

Is it possible in NT to disable all swap files at all?
If yes - this would have the same effect.

I’ve heard that NT’s MM will not allow this, since the swap file minimal
size must be equal to the RAM size. Is it really so?

Max


You are currently subscribed to ntdev as: xxxxx@seagate.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

I have tried the solution, which Pavel Hrdina mentioned (ExAllocatePool and
MmProbeAndLockPages). ExAllocate works, but i can get a MDL for the memory
block. I can find any mistake in my source, maybe somebody can help me. I
know allocating more than 100MB is not very common in device programming,
but i think it should be possible (or not !?).

Here is a part of the source, which does the memory allocation:

pDiskEx->DiskImage = ExAllocatePoolWithTag( PagedPool,
pDiskEx->Parameters.DiskSize,
RAMDISK_TAG_DISK);
if(pDiskEx->DiskImage)
{
DBGPRINT( DBG_COMP_INIT, DBG_LEVEL_INFO,
(“Allocate %i bytes of paged memory (%X)\n”,
pDiskEx->Parameters.DiskSize,pDiskEx->DiskImage) );

pDiskEx->DiskMDL = IoAllocateMdl(pDiskEx->DiskImage,
pDiskEx->Parameters.DiskSize,
FALSE,
FALSE,
NULL);
if(pDiskEx->DiskMDL)
{
DBGPRINT( DBG_COMP_INIT, DBG_LEVEL_INFO,
(“Allocated MDL %X for memory %X\n”,
pDiskEx->DiskMDL,pDiskEx->DiskImage) );
MmProbeAndLockPages(pDiskEx->DiskMDL,
KernelMode,IoModifyAccess);
}
else
{
DBGPRINT( DBG_COMP_INIT, DBG_LEVEL_INFO,
(“Failed to Allocate MDL for memory %X\n”,
pDiskEx->DiskImage) );
}
}

And here is the output of the driver:

RAMDISK: Allocate 88080384 bytes of paged memory (E1400000)
RAMDISK: Failed to Allocate MDL for memory E1400000

A. Roth


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

There is a limit to the logical size of an mdl that one can allocate using
IoAllocateMdl, and that limit is ~64MB. You can build (manually) an mdl that
will describe this 100MB chunk, or you can use the documented interfaces and
build more than one mdl to cover the area. At least in nt4 and w2k using
such mdls did no harm, as the size is only enforced in the call to
IoAllocate. However, unless there is some overwhelming reason not to use two
mdls, I’d go for that solution.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andreas Roth
Sent: Tuesday, January 22, 2002 3:26 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Allocate more than 100MB

I have tried the solution, which Pavel Hrdina mentioned
(ExAllocatePool and MmProbeAndLockPages). ExAllocate works,
but i can get a MDL for the memory block. I can find any
mistake in my source, maybe somebody can help me. I know
allocating more than 100MB is not very common in device
programming, but i think it should be possible (or not !?).

Here is a part of the source, which does the memory allocation:

pDiskEx->DiskImage = ExAllocatePoolWithTag( PagedPool,

pDiskEx->Parameters.DiskSize,

RAMDISK_TAG_DISK);
if(pDiskEx->DiskImage)
{
DBGPRINT( DBG_COMP_INIT, DBG_LEVEL_INFO,
(“Allocate %i bytes of paged memory (%X)\n”,

pDiskEx->Parameters.DiskSize,pDiskEx->DiskImage) );

pDiskEx->DiskMDL = IoAllocateMdl(pDiskEx->DiskImage,

pDiskEx->Parameters.DiskSize,
FALSE,
FALSE,
NULL);
if(pDiskEx->DiskMDL)
{
DBGPRINT( DBG_COMP_INIT, DBG_LEVEL_INFO,
(“Allocated MDL %X for memory %X\n”,
pDiskEx->DiskMDL,pDiskEx->DiskImage) );
MmProbeAndLockPages(pDiskEx->DiskMDL,

KernelMode,IoModifyAccess);
}
else
{
DBGPRINT( DBG_COMP_INIT, DBG_LEVEL_INFO,
(“Failed to Allocate MDL for
memory %X\n”,
pDiskEx->DiskImage) );
}
}

And here is the output of the driver:

RAMDISK: Allocate 88080384 bytes of paged memory (E1400000)
RAMDISK: Failed to Allocate MDL for memory E1400000

A. Roth


You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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