Jump to content
  • Advertisement
Sign in to follow this  
godmodder

Virtual address space of 32-bit app in 64-bit OS

This topic is 1943 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

 

My application is 32-bit and runs fine on huge datasets in 64-bit Ubuntu. Memory usage goes up to about 6.7GB of RAM.

However, on 64-bit Windows I get std::bad_alloc exceptions, presumably because I'm limited to 2GB of virtual address space for 32-bit apps. I have tried to link with the /LARGEADDRESSAWARE flag, which increases this limit. Indeed this seems to stall the crash, but around 4GB it still fails.

 

Is there a way to circumvent this limitation in Windows, without resorting to full porting to 64-bit? Why doesn't Ubuntu suffer from this limitation, as after all the application is 32-bit on there as well?

 

Thanks,

Jeroen

Share this post


Link to post
Share on other sites
Advertisement

If the memory usage goes to 6.7GB, then it's running in 64 bit mode in Ubuntu. If you compile with gcc in a 64-bit linux, it will create 64-bit binaries unless you tell it explicitly not do do so (-m32 flag). Are you sure, that the Ubuntu binary is 32 bit? Does the "file executable.binary" command tell you "ELF 32-bit LSB executable, Intel 80386"?

Share this post


Link to post
Share on other sites

You're right, it's generating a 64 bit binary by default. Ok, looks like I will have to compile against x64 on Windows too then.

 

Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!