A 32-bit application by definition uses 32-bit (virtual) memory addresses, which are limited to 2^32 (4GB) possible memory locations. In reality, you're likely to get only 2GB or 3GB user-land memory in a 32-bit application under 32-bit Linux, because of how Linux sets up your process map (the kernel is mapped into the other 1GB or 2GB, depending on options specified in the build of the kernel and core libraries your system is running). On 64-bit Linux, process memory is laid out a bit differently, so you can actually get just less than 4GB (see here for more info). If you need more memory than that, you'll need to compile as a 64-bit application.