Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was wondering... 64bits OSs can run 32bits applications right? Windows use WoW64 to achieve this right?

My question is, when these applications are run, does they use 64bits or 32bits addresses? I was wondering this because of the memory usage...

share|improve this question

3 Answers 3

up vote 4 down vote accepted

Internally, every program sees about 2GB of memory space (there is flag one can set to get 3GB) and therefore never has to need 64-bit pointers (32-bit pointers will work fine). The OS can handle all the 64-bit real memory management under the hood.

Not quite sure what this has to do with memory usage.

share|improve this answer
    
Because 64bits programs uses more memory because they need 64bits pointers. –  Zequez Aug 16 '11 at 3:33
    
That is such a tiny tiny difference that it does not matter (32 bits per pointer). In addition, to actually get used, the pointers the program uses have to be converted to the 64-bit real addresses anyway, so it does not prevent a 64-bit address from being stored. –  soandos Aug 16 '11 at 3:36
    
@soandos, while it is true that for an individual application the difference in pointer size will affect the memory footprint minimally. On the os side - the 64 bit pointer increase will quadruple the size of the page table required. Page tables on a loaded 32 bit system can reach 50MB, quadrupling that is not a small difference. –  crasic Aug 16 '11 at 6:01
    
@crasic it quadruples the maximum size, not the actual size. –  soandos Aug 16 '11 at 6:06
    
@soandos assuming we keep the same page size (of course that is a maybe) it will quadruple the current page table size. Think about it logically - if we pad pointer in our 32bit PT with 0's just for the hell of it it will at least quadruple in size (assuming a flat PT, which is reasonable enough for a size approximation) –  crasic Aug 16 '11 at 6:13

32 bit applications can only see 32 bit addresses. WoW64 simulates the 32 bit environment inside the 64 bit memory space for 32 bit applications.

share|improve this answer
    
So the 32bits application uses the same amount of memory it would use in a 32bits environment? –  Zequez Aug 16 '11 at 3:35
1  
I dont know the exact answer, so im venturing a guess. The applications themselves would probably use the same amount of memory in a 64 bit environment as they would in a 32 bit environment. However, more memory is used to by WoW64 in order to map those environments. –  Keltari Aug 16 '11 at 3:38

Your question isn't very specific since you don't distinguish between virtual memory address and physical memory addresses.

Yes, x86 programs are going to use more memory and resources. They will have a 32 bit virtual address space, but underneath, the Memory Manager (MM or MMM) will use x64 pointers. Not like that takes a whole lot of effort though.

By far the biggest resource cost is drivers. There were some substantial kernel changes, many due to security, that required large parts of drivers to be rewritten.

Internally, every program sees about 2GB of memory space (there is flag one can set to get 3GB) and therefore never has to need 64-bit pointers (32-bit pointers will work fine). The OS can handle all the 64-bit real memory management under the hood.

I believe this is untrue. Every program sees 4GB (32 bit virtual address space) but the kernel splits the physical address space in half. The two 2GB you are familiar with refers to the physical memory address.

share|improve this answer
    
This answer deserves an upvote since it is the only one that mentions the salient terms virtual and physical memory addresses. Other answers that try to explain relationships between userspace memory and memory management without specifying the memory space of the pointer or address are vague and probably misleading. –  sawdust Aug 16 '11 at 18:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.