Sign in to follow this  
godmodder

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this