LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices



Reply
 
Search this Thread
Old 08-07-2012, 02:31 AM   #1
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Rep: Reputation: Disabled
Smile 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?
 
Old 08-07-2012, 02:42 AM   #2
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 314

Rep: Reputation: 77
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
 
Old 08-07-2012, 02:54 AM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Rep: Reputation: 62
How the hell did you get an .EXE file on LINUX???!!!
 
Old 08-07-2012, 03:17 AM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,590

Rep: Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227
Quote:
Originally Posted by resetreset View Post
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.
 
Old 08-07-2012, 03:31 AM   #5
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Dear evo2,

Sorry But i m running this on windows machine......
 
Old 08-07-2012, 03:36 AM   #6
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,590

Rep: Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227
Hi,

Quote:
Originally Posted by gajananh999 View Post
Sorry But i m running this on windows machine......
Umm, you are aware that you are posting on a Linux forum, right?

Evo2.
 
Old 08-07-2012, 03:43 AM   #7
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Dear Evo2,

Ya..... but running a .exe file on LINUX or windows the amount of memory used will be same?
 
Old 08-07-2012, 03:48 AM   #8
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,590

Rep: Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227Reputation: 1227
Hi,
Quote:
Originally Posted by gajananh999 View Post
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.
 
Old 08-07-2012, 08:22 AM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,447
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
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.
 
Old 08-07-2012, 09:16 AM   #10
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get wine to run 64-bit .exe programs Parisa Tatapudy Linux - Newbie 10 05-28-2012 06:38 AM
same fortran code but giving different results for the 32 bit vs 64 bit machine nareshUN Linux - Software 3 02-21-2012 12:33 PM
[SOLVED] 32 bit binaries do not run on 64 bit machine frznchckn Linux - Software 51 02-28-2011 01:20 PM
[SOLVED] Red Hat Enterprise Desktop 5.3 on 64 bit machine need 32-bit library file hhs1982 Linux - Newbie 4 06-29-2010 12:55 PM
[SOLVED] File size limitations of a 32 bit program running under a 64 bit kernel acerostech Linux - Server 1 04-19-2009 11:01 AM


All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration