How to extend the allowed physical memory?

G

Guest

I have an application that fails to allocate all its memory on physical memory.
I have a Windows XP with 2 GByte RAM.

Can anybody tell me how to configure the allowed physical memory for each
application in the Windows XP so the application memory allocation will not
use any of the virtual memory?

I’m not talking about the .NET framework. I need to configure the Windows
itself.
 
J

Jeffrey Tan[MSFT]

Hi Sharon,

Thanks for your post.

I think this issue has nothing to do with .Net Framework, so I suggest you
post such issue in SDK related newsgroup later on. Thanks

Based on my understanding, you want to allocate a block of memory in RAM
without paged out to the disk.

Windows provided a technology named AWE, which allows user applications to
use up to 64 GB of physical non-paged memory in a 32-bit virtual address
space on 32-bit platforms, with windowed views to this physical memory from
within the application's virtual address space.

More specificly, we use AllocateUserPhysicalPages to alloc the memory in
RAM, then use VirtualAlloc to reserve in process Virual memory space, then
use MapUserPhysicalPages to map the physical memory to the space we
reserved before. But please note, we have to enable SE_LOCK_MEMORY_NAME
privilege before these operations.

For more information, please refer to:
"Address Windowing Extensions"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base
/address_windowing_extensions.asp
"AWE Example"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base
/awe_example.asp
"Address Windowing Extensions and Microsoft Windows 2000 Datacenter Server"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngenlib/ht
ml/awewindata.asp

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Hi Jeffrey,

Thank a lot for the inof.

The trouble is that we have two PC’s with the same exact hardware and the
same Windows XP. And my same application is running on these two computers,
on one of them the allocation is all on the physical memory, but on the other
PC it’s not.

I need the memory to be all on the physical memory because I passing this
memory to a frame grabber that need and check that that this memory is
continuous on the physical memory, so it fails on one of the computer.

So you see, I think this problem is in some kind of setting of the system
(Windows XP) and not in the code changing.

Can you figure out the setting I need to do in order to make the second
computer work as well?
 
W

Willy Denoyette [MVP]

You can request the system for physical memory by calling
AllocateUserPhysicalPages but you should NEVER assume contiguity of the
physical pages, windows does not collect physical memory, so it can never
guarantee contiguity of RAM pages returned by AllocateUserPhysicalPages .

If it works on one PC and not on another can be caused by differences in HW
and SW (OS and user applications), differences in load order of applications
and services, differences in number and type of device drivers and their
load order, in one word if it works on one PC doesn't mean it will on
another, it only means that you were lucky (this time).


Willy.
 
J

Jeffrey Tan[MSFT]

Hi Sharon,

Thanks for your feedback.

Yes, I agree with "Willy Denoyette [MVP]". Normally, Windows uses paging to
implement the virtual memory. Due to the paging, the continuous Virtual
memory can not be guaranteed to be continuous in RAM.

If you really want this, I think you have to turn off paging for your
system.

Currently, this is not a development issue, I suggest you paste this issue
in certain Windows OS newsgroup, you will get more useful and professional
help there. Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top