Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
So I have a process running 64bit, which I use to allocate memory in a foreign 32bit process, I was wondering isn't it possible to alloc memory over the 0x7FFFFFFF memory address limit on the 32bit process?
Posted
Comments
Sergey Alexandrovich Kryukov 28-Oct-14 12:42pm    
I wonder why?
—SA

I don't know why are you doing all that, but such allocation depends on the platform. Also, the actual possibility to allocate so much memory depends on the actual use of the memory at the moment; I guess you understand it.

Let's see. The address space of a 32-bit process is limited by the type of its address word, which it 32 bits, which gives you 4G. You require 2G. On a 32-bit platform, this is all the memory dedicated to all code taken together, those in the outer (user) protection ring. Other 2G is dedicated to the OS internals. According to documentation, system configuration can be changed to leave 3G to the applications, but I never tried it.

But it looks like you are only interested in allocation of the memory on a 64-bit system. Then, even if your process is a 32-bit one, it can use up to 4G of memory (excluding the memory already used by code and static data, plus some overhead, of course, hard to say how much; you can experiment with it). This is because each process is given its own address space (32-bit address space, in your case, 4G); different 32-bit processes don't compete over the common 4G space; instead, they are loaded independently using the Windows sub-system WoW64, which is a 64-bit layer used to support 32-bit processes:
http://en.wikipedia.org/wiki/WoW64[^].

—SA
 
Share this answer
 
v3
Comments
CPallini 28-Oct-14 13:01pm    
WoW!
5.
Sergey Alexandrovich Kryukov 28-Oct-14 13:04pm    
Thank you, Carlo. :-)
—SA
First of, to my knowledge it is not possible to allocate memory from one process in another process. So from that point, your question doesn't make sense to me. Possibly, you mean that you want to access memory in another process.

Secondly, in 32-bit Windows processes, the upper half of the memory space (7FFFFFFF to FFFFFFFF) is reserved to the operating system. So a process cannot allocate memory there nor access that part of memory. (On newer Windows versions, that limit can be shifted upward from the 2GB to the 3GB boundary, or in other words, only the upper forth of the address space is reserved by the system. This option can be enabled by an option switch on process creation time).

So in any case: The answer to your question is: "No".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900