If you have 32 bit java, you can only allocate 1 GB of RAM. If you have a 64 bit OS, bit 64 bit Java.
Lag can be caused by not enough allocated RAM, a bad graphics card, a graphics card setting that tells java to use integrated processor graphics, or an overall bad computer, and some more I'm sure.