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

Started by
1 comment, last by godmodder 11 years ago

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

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"?

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!

This topic is closed to new replies.

Advertisement