Home > Software engineering >  Why the same program, use the memory on a 64 - bit system will be more than those of the 32 bit?
Why the same program, use the memory on a 64 - bit system will be more than those of the 32 bit?

Time:10-25

Server program, a run on Windows server 2003 (32), a run on 2008 (64), and 2003 the number of threads on more than 2008, but the memory used by 2003 less than 100 m in 2008, who have been familiar with this area?

CodePudding user response:

1, the system is different, a 64 - bit Windows more than 32 bit complicated, not only expand the address length that simple,
2200 3 architecture and 2008 completely different, you use 32-bit and 64 - bit 2003 2003 is also about the same,
3, address and data field length increase

CodePudding user response:

The same code, 32 (compiled binary size is different,

CodePudding user response:

I guess it is like this:
32-bit system less physical memory because of you, so want to have most of the program to cache to disk, when you put the application on a 64 - bit system, because of the physical memory is more, so there's no need to put a lot of application cache to disk, repeat the procedure in physical memory, so 64 is more than the 32-bit memory

CodePudding user response:

Is the default byte alignment problem?
32-bit is 4, 64 was eight,,, you should be bigger,

You all to pragma pack (1),

CodePudding user response:

reference 4 floor tiger9991 response:
is the default byte alignment problem?
32-bit is 4, 64 was eight,,, you should be bigger,

You all to pragma pack (1) see,

If so, the code can run without error in Windows, it was a miracle
At the beginning I have eaten here, there is no question about the compilation, no problem with the ordinary run
But to some point, they collapse, find out the errors or MFC internal

CodePudding user response:

1,3,5 floor said is right

CodePudding user response:

reference xiaoyuanyuan2009 reply: 3/f
I guess it is like this:
32-bit system less physical memory because of you, so want to have most of the program to cache to disk, when you put the application on a 64 - bit system, because of the physical memory is more, so there's no need to put a lot of application cache to disk, repeat the procedure in physical memory, so 64 is more than the 32-bit memory


32-bit and 64 - bit systems because the address length is different, so the virtual address size is different, and they use the physical memory size has no direct relation (decision can only use one of the biggest physical memory, such as 32-bit only to the largest 4 g, 64 to 2 ^ 64), of course it's decision, a 64 - bit OS than 32 bit can use more memory, but that does not answer questions main question: why would cost more memory,
I think it should be: 1. Address length - & gt; Command set different - & gt; Compiled bin bigger (due to the underlying data are to be obtained and address related);
2. Address space greatens, & gt; Memory page table larger
3. The system complex, & gt; The kernel of the increase in the number of memory
  • Related