I'm currently coding on my laptop: 4 gb of rams, never using more than 2.5-3gb but at times, I'll mess up my programs, run them with memory leaks and they'll make the computer freeze when trying to write in the swap file (something related to low value of swapiness). It put me close to losing important data a few times and so I'd like to have my computer working another way: no swap file, as I said I've never needed more than 3gb of ram when using it, and making the OS crash a program that would try to use more ram than available (it will always an ill coded program of my own). How can I get my setup this way?
Thank you in advance.