getting "out of memory" error when trying to load specific websites (am not out of RAM)
I wasn't able to get my network back by disabling and re-enabling TCP/IP or the Wi-Fi. It seems in my case the computer had gone to sleep with a Juniper VPN connection and when it woke back up the connection had timed out and the routes weren't cleaned up. For me, I had two computers, one working and one not, and so was able to identify the problem after running netstat -rn.

On the computer that wasn't working, I had a destination of 192.168.43.1 with a gateway of link#5. On the computer that WAS working, the gateway for that destination was the mac address of the wireless router, so I removed that route with:

sudo route delete -host 192.168.43.1


After this, I could ping my wireless router and also get back to the internet.

Some people claimed that going to Settings → Network → Wi-Fi → Advanced → Proxies and turning on Auto Proxy Discovery worked for them. I was not able to verify this as my connection was fixed by deleting the 'dead' route.