> We could use 3g as the max heap size,but failed with 4g.
> Any suggestions?
IF you have a 32 bit machine, you have a 4GIG addressing limit. You
have to leave some room for the OS, code, DLLs etc.
Look into a 64-bit machine.
see
http://mindprod.com/bgloss/sixtyfourbit.html
that is not a type. bgloss is the hardware glossary.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.