Various random website cannot be reached (cannot allocate memory)
What fixes it for me for wireless connection is this:


Go to network preferences
Open the connection data
Open "Advanced..." properties
Go to "TCP/IP" tab
Set "Configure IPv4" to off (remember the previous setting)
Click "OK" and then Apply
Wait for the connection to be reset
Go back to TCP/IP and re-enable IPv4 to the previous setting
Click "OK" and then "Apply" again


After the connection restores, the memory errors are gone. Still no idea why it happens or why this fixes it, but seems to work for me and is much faster than rebooting.