Java Could not reserve enough space for object heap error

I have Java7 running on 32-bit Windows and 4 GB RAM, but: …still does not work. Error: Error occurred during initialization of VMCould not reserve enough space for object heapError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit. java -Xmx1G -Xms1G -jar Minecraft.jar is working. Why?