If you encounter a game crash indicating that “Don’t Starve Together has run out of memory and must shut down” this typically is due to two things:
1. Your computer does not meet the game’s minimum system requirements, specifically for RAM and Graphics card.
Computers with video cards under 256 MB will experience intermittent crashing issues as Don't Starve Together requires video cards with at least 256 MB or over. Also please ensure that your computer surpasses the memory requirements if you are hosting a server or running a dedicated server.
Check out Don't Starve Together's system requirements here. (If the computer falls below the system requirements, it will not be able to run the game properly.)
If your system is close to the threshold of supported requirements as listed in the link above, you can try enabling "Netbook Mode", Small Textures, or lower the screen resolution in the game's options menu to see if those help alleviate the issue.
2. There is currently a faulty or out-of-date mod on either the server or client-side that is causing a memory leak with your game.
If you have mods installed, ensure that all mod files have been deleted completely from your MODS folder for Don't Starve Together on Steam both for your client and/or from the server itself. You can do that by going into your Steam folders for Don't Starve Together and fully delete the contents of your game's "Mods" folder. \Steam\steamapps\common\Don't Starve Together\mods\
After deleting the mod files, go to the Steam Workshop for Don't Starve Together (while logged into your Steam account) and unsubscribe ALL of your mods so that the problem mod is not re-downloaded to your game the next time you run it.
Once the mods have been unsubscribed, verify the integrity of game files on the Steam client.
After verifying the integrity of game files, you can launch Don't Starve Together once more.