If you suffer from frequent crashes/lagging/hanging in game and/or the dreaded Error 12, this may be because your Mac is running out of RAM whilst you’re playing. You need to free some of it up and you can easily do this whilst you’re playing. You can buy apps from the App Store to do this but why bother when you can do it through Terminal for free? You can do this when your game starts to lag noticeably which seems to happen to me when I’m moving between Vacation, University and Home worlds in The Sims 3.
If you get “Command not found” in Terminal you may need to download Xcode in order for it to work. It’s free, provided by Apple, and available from the App Store. If you’re running Snow Leopard you can install Xcode from the disc that came with your Mac.
Firstly, play in windowed mode so you can see what you’re doing. With the game running (and paused) hold down CMD and press Enter. Next, open up Activity Monitor and see how much free RAM you have:
Applications > Utilities > Activity Monitor
If it’s low you definitely need to free some up. Open up Terminal:
Applications > Utilities > Terminal
OS X Mountain Lion 10.8 and earlier –
Type in purge and hit Enter. After a few moments you should see the free RAM figure increase:
Your game should now perform a bit quicker. There’s no limit to the amount of times you can do this.
This is by no means a magical fix for the numerous crashing/lagging/hanging issues but it can help if your issues are memory related.
OS X Mavericks 10.9 or later –
Typing purge no longer works due to the new compressed memory feature built into Mavericks. However you can still purge the RAM by entering “sudo purge” (without the quotation marks) into Terminal. You will get a warning message and a prompt to enter your password. Once you enter your password the memory will be freed up. When you type in your password it will not appear – just keep typing and hit Enter.
Activity Monitor has also changed slightly. This is what you will see instead of the images above: