I have installed Kali Linux on the Raspberry Pi B+ (512 MB). When I start Metasploit (msfconsole), the device runs out of memory. I am fairly new to Linux, will increasing the swap size allow me to run the commands without an issue?

Is it better to add a swap partition or swap file?

What are the commands?