LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   running 32 bit C code .exe file using more memory to run on 64 bit machine? (https://www.linuxquestions.org/questions/general-10/running-32-bit-c-code-exe-file-using-more-memory-to-run-on-64-bit-machine-4175420761/)

gajananh999 08-07-2012 01:31 AM

running 32 bit C code .exe file using more memory to run on 64 bit machine?
 
Dear All

I have one .exe file which i have compiled on 32 bit machine and when i run this file from 32 bit machine it is taking maximum 12MB. and when i run same file from 64 bit machine it is going up to 1GB . i m not understanding how is it happening.

is memory use of .exe files depends on System Type?

Celyr 08-07-2012 01:42 AM

I think yes because of size of pointers etc. But the difference should no that big.
I suspect there is a bug in your binary somewhere

resetreset 08-07-2012 01:54 AM

How the hell did you get an .EXE file on LINUX???!!!

evo2 08-07-2012 02:17 AM

Quote:

Originally Posted by resetreset (Post 4747810)
How the hell did you get an .EXE file on LINUX???!!!

Code:


% cat <<EOF > hw.cc
#include <iostream>
int main() { std::cout << "Hello, world!"<<std::endl;}
EOF
% g++ -o hw.exe hw.cc
% ./hw.exe
Hello, world!

;-)

Evo2.

gajananh999 08-07-2012 02:31 AM

Dear evo2,

Sorry But i m running this on windows machine......

evo2 08-07-2012 02:36 AM

Hi,

Quote:

Originally Posted by gajananh999 (Post 4747843)
Sorry But i m running this on windows machine......

Umm, you are aware that you are posting on a Linux forum, right?

Evo2.

gajananh999 08-07-2012 02:43 AM

Dear Evo2,

Ya..... but running a .exe file on LINUX or windows the amount of memory used will be same?

evo2 08-07-2012 02:48 AM

Hi,
Quote:

Originally Posted by gajananh999 (Post 4747856)
Ya..... but running a .exe file on LINUX or windows the amount of memory used will be same?

I doubt it. I would expect it to depend heavily on the compiler and OS.

Evo2.

onebuck 08-07-2012 07:22 AM

Moderator Response
 
Moved: This thread is more suitable in <General> and has been moved accordingly to help your thread/question get the exposure it deserves.

sundialsvcs 08-07-2012 08:16 AM

You can't compare the execution-time characteristics of one operating system with another.

This is true both when you compare Windows to Linux, and even when you compare 32-bit to 64-bit implementations of the same system.

One key reason for the latter is "all the other stuff" that's running when your system is running. The libraries the app opens, and so forth. The system may promise that your application will run in the different environment, but it does not promise that the environment is the same; it is not.


All times are GMT -5. The time now is 05:54 AM.