To answer your first question more information on what's going on (what's using all the memory) is required. I don't know why the .bashrc is causing a problem, but you can delete it or change it.
If needed, as a debugging step perhaps you could try adding a large swap file to delay the out of memory situation long enough to see what process is causing the problem and kill/fix it if it's unrelated to your .bashrc changes.
To access your filesystem for recovery or to backup your data you can use a boot disk and mount your hard drive(s) with it. This will bypass whatever is wrong with your installation.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/ap-rescuemode.html
Alternatively, instead of single user mode or rescue CDs you can try appending "init=/bin/bash" to the linux line in grub by editing the first menu entry when the grub menu first appears on boot. This will prevent anything from loading and go straight to bash after the kernel loads rather than starting runlevel 1.
Once you get a command prompt, you'll likely want to remount your filesystem(s) read-write with a command such as:
mount -oremount,rw /
Once you have access to your files, you can copy over the network or to external storage or fix your problem.