参考:https://superuser.com/questions/152921/how-to-boot-with-mem-1024m-argument-using-grub-ubuntu-10-04
With Ubuntu and Debian-based installations that use Grub2, you shouldn't edit /boot/grub/grub.cfgdirectly. That file is configured by running the update-grub command, which happens automatically at various times (like when installing new kernel images).
Instead, you need to add kernel commandline options to the GRUB_CMDLINE_LINUX or GRUB_CMDLINE_LINUX_DEFAULT variables in /etc/default/grub:
# these options don't get added to recovery boot entry
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# these options get added to both standard and recovery boot entries
GRUB_CMDLINE_LINUX="var1 var2 mem=1024m"
Once you've finished editing, don't forget to generate a fresh Grub menu with the changes:
sudo update-grub