Bohdan
Bohdan

Reputation: 17193

How much memory can an application use in 32bit Linux machine?

I'm new to Linux and have a question about memory limitations.

As I know, in Windows you can only have 2.8 GB used in the 32bit version of OS, but what about Linux - is it 4 GB or less too?

I'm particularly interested in Java application run in RHEL5. But if you have answers about other technologies - that would be awesome to listen to.

Upvotes: 1

Views: 904

Answers (2)

Daniel Muino
Daniel Muino

Reputation: 46

RHEL5 32-bit provides 3G/1G split for user processes and the kernel respectively.

That means a single process can only access up to 3G of address space. The system itself can have more than 4G of RAM, and all of that will be available to the kernel if you're using a PAE kernel. And the kernel will be able to properly distribute that memory across different user processes.

Upvotes: 3

It is probably at most 3Gbytes (but some weird kernel configure options could raise that, perhaps to 3.3Gbytes)

You can lower the available memory limits with the setrlimit(2) syscall (perhaps thru the ulimit bash builtin)

If you have a big iron with much more than 4Gbytes RAM installing a 64 bits distribution should make sense.

You might perhaps consider also compiling your Java application ahead of time with e.g. gcj, but that compiler is out of fashion and supports only an old Java standard; and I am not sure you'll win some memory space (perhaps a few megabytes, because its runtime is much smaller than your JVM).

Upvotes: 3

Related Questions