I can't allocate more memory to minecraft?

Everytime i try to allocate more ram and run it a message pops up saying that is failed to run the java virtual machine or something like that and i have the latest version of java

pc specs:
windows 8
8 Gigabytes of ram
500 gigabyte hard drive
64-bit operating system

i'm trying to allocate 4 gigs of ram and this is what i'm putting -Xmx4096M -Xms4096M or -Xmx4G -Xms4G

if you need any more info tell me and ill update the info

I don't think your pc can handle it but i don't know. There's a better and faster way though.

1: open launcher to minecraft
2:where it says profile click options
3:At bottom it says JVM arguments change that to 4GB instead of 1GB
4: click save profile

Now you have more ram strictly to minecraft