Which maximum max heap size (-Xmx) can be set?

What is the maximum value can I put to java as max heap size -Xmx ?

I have java for linux 32 and setting -Xmx2048m causes to OutOfMemory during JBoss startup

Reducing this value to 1G-1.7G solves this problem.

Is this value depends from Linux 32 or 64 if I run under java 32 ?