Replies: 7 (Who?), Viewed: 3722 times.
Field Researcher
Original Poster
#1 Old 27th Feb 2018 at 12:42 AM Last edited by muridae : 22nd Jul 2020 at 7:13 PM.

This user has the following games installed:

Sims 2, University, Nightlife, Open for Business, Pets, Seasons, Bon Voyage
Default Tutorial: Sims 2 Super Collection for Mac - Increasing the Maximum File Limit
{As discussed earlier in Stupid/Random Questions, this is the first of what will probably be several Mac-focussed guides on how to tweak the game. Please move it to the appropriate place, then I'll delete this preamble. There are 7 inline images, which I hope isn't excessive for a tutorial.)

Update 08/05/2018: PDF version of the tutorial added.
Update 13/05/2020: Images re-uploaded, since the modyourpanties versions went away.
Update 22/07/2020: Information about increased maxfiles and maxproc limits at higher versions of macOS added.

NOTE: This information is mostly for Mac Sims players running 10.11 (El Capitan) or 10.12 (Sierra). OS X 10.9 (Mavericks) and 10.10 (Yosemite) work differently - see the link at the end for information on how to increase the limit for them. 10.13 (High Sierra) has increased limits, though they may still be low enough that you might want to increase them. 10.14 (Mojave) has even higher limits, to the point where it becomes increasingly unlikely that a player will hit them.

macOS versionkern.maxfilesperprockern.maxfileskern.maxprocperuidkern.maxproc
10.12 (Sierra) and below10240122887091064
10.13 (High Sierra)184323686410641596
10.14 (Mojave)368647372821283192

Background

By default the maximum number of files a modern Mac can open is set to 12,288, and the maximum files a single process (for instance, Sims 2) can open is set to 10,240. Most applications won’t ever need more than that. Sims 2, of course, is pretty greedy about resources on your computer in general, and if you want to add a lot of custom content then all those little *.package files add up. If you go on a download spree you can find yourself hitting that upper limit pretty quickly.

That wouldn’t be as big a problem if the game just complained and crashed. Unfortunately, if you attempt to load more files than your maximum limit the game will just skip loading some of them. If you’re unlucky, those skipped files can leave you with missing Sims and missing lots and a corrupt neighbourhood.

If you want to minimise your risk without making drastic changes the easiest thing you can do is delete any premade neighbourhoods you have no intention of playing. It’s easy to get them back again, either by selecting Options → Game Settings on the launcher and then “Restore Neighborhood: name” from the Game Utilities dropdown, or by installing a clean template. But leaving them there can add hundreds of files per neighbourhood to your open files count.

If you want a lot of custom content and you want to play several different neighbourhoods though, you’re probably going to want to increase that maximum file limit.

Increasing the OS X/macOS File Limit

The first thing to do is to check what your current file limit is. Go to Applications -> Utilities and launch the Terminal app, which looks like this:



Cut and paste the commands below into Terminal (you can either do it as one block or a line at a time):

Code:
launchctl limit|grep maxfiles
sysctl kern.maxfilesperproc
sysctl kern.maxfiles
launchctl limit|grep maxproc
sysctl kern.maxproc
sysctl kern.maxprocperuid

What you’ll probably see, if you’ve not made any amendments to the file limits before, is this:



kern.maxfilesperproc is the maximum number of files a single process (e.g. Sims 2) can use
kern.maxfiles is the maximum number of files your entire system can use
kern.maxprocperuid is the maximum number of processes your user can use
kern.maxproc is the maximum number of processes your entire system can use

These are the values we’re going to change.

Unzip the attachment (maxfiles_maxproc_plist.zip). This contains two files limit.maxfiles.plist and limit.maxprocs.plist. If you open them in a text editor, they look like this:

limit.maxfiles.plist:


65536 is the value for kern.maxfiles. I've been unable to find the official upper limit but I wouldn't add more than this unless you have huge amounts of RAM to cope with it as it'll increase demand on your system resources. If you think it’s too much, you can edit the file and change it to a smaller number, such as 20480.

63488 is the value for kern.maxfilesperproc. Keep this lower than kern.maxfiles, as that leaves room for the operating system and other applications to open files as well. I would subtract 2048, as macOS does. So, if you set kern.maxfiles to 20480, kern.maxfilesperproc should be 18432.

limit.maxproc.plist:


2500 is the largest value you can set for kern.maxproc and kern.maxprocperuid. If you set it any higher (or to unlimited) macOS will ignore the settings entirely. Again, you can edit the file and set it lower if you want.

The two plist files now need to be placed in /Library/LaunchDaemons so that they run when your Mac boots up. Drag the files from where you unpacked them to /Library/LaunchDaemons. Because this is a system folder, you’ll get a prompt to confirm the file move with your administrator username and password, like this:



Click on AUTHENTICATE.



Type in your administrator password, then click OK.

The files are now in the right place, but they need to have their permissions changed so that they run as the system rather than your user account.

Open Terminal again, and change owner and group to root:wheel and file access permissions to 644:

Code:
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist



You’ll be prompted for your Administrator password details at this point. Type it in and hit enter.

Make the remaining changes (shown below). You shouldn’t be asked for your password again.

Code:
sudo chown root:wheel /Library/LaunchDaemons/limit.maxproc.plist
sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
sudo chmod 644 /Library/LaunchDaemons/limit.maxproc.plist

Check that the file permissions are now correct by typing this:

Code:
ls -l /Library/LaunchDaemons/limit.max*.plist

They should look like this:



You now need to restart your Mac in order to pick up the new file limit settings.

Once the reboot is complete, open Terminal again and cut and paste the commands to check your max files settings again:

Code:
launchctl limit|grep maxfiles
sysctl kern.maxfilesperproc
sysctl kern.maxfiles
launchctl limit|grep maxproc
sysctl kern.maxproc
sysctl kern.maxprocperuid



You should now see that they match the numbers in the two new plist files. Congratulations, you’ve increased the file limit on your Mac.

Resetting the File Limit

If you ever decide that you don’t want the increased file limits, you can get rid of them by going to /Library/LaunchDaemons and deleting limit.maxfiles.plist and limit.maxproc.plist. You’ll be asked to type in your Administrator password to do so. Empty trash to delete the files, then reboot, and you should be back to the default macOS file limits again.

Further Information

http://bunsim.tumblr.com/MacFileLimitHelp (background information, and the different method of increasing file limits for OS X 10.9/Mavericks and 10.10/Yosemite)
http://www.insimenator.org/index.ph...html#msg1628939 (increasing file limits for OS X 10.11/El Capitan and above)
Screenshots
Attached Images
 
Download - please read all instructions before downloading any files!
File Type: zip maxfiles_maxproc_plists.zip (899 Bytes, 62 downloads) - View custom content
Description: plist files
File Type: zip Sims 2 Super Collection for Mac – Increasing the Maximum File Limit.pdf.zip (250.8 KB, 45 downloads) - View custom content
Description: Tutorial in PDF form
Advertisement
Field Researcher
#2 Old 27th Feb 2018 at 9:19 PM
Logged in just to tell you I REALLY appreciate this thread.



I play on a Mac and have encountered some terrible issues that i think are related to this.

MTS does not allow us to delete our accounts. I will not be logging into this account anymore, so PMs would go unanswered.
Test Subject
#3 Old 27th Feb 2018 at 10:15 PM
Ah you did it!!! Thank you sooooooo much!!! I will be trying this later.
Test Subject
#4 Old 8th May 2018 at 9:51 PM
Ahhhh I stopped messing with this for awhile and never tried doing this till now. Unfortunately a couple of the images you posted of the codes to enter in terminal are not showing up!! Could you possibly repost those? I'm at the part where my files are in the right place, I just need to change the permissions. I know it's been awhile since you posted this but I would be so grateful!! Thanks so much again for taking the time to post this thread
Field Researcher
Original Poster
#5 Old 8th May 2018 at 10:17 PM
Hi @mxyx -

The images were uploaded to modyourpanties.com, which isn't responding for me right now. That's probably why they're not showing up, but hopefully it's a temporary problem.

I still had my first draft of the tutorial as a Word file (including all the images at the appropriate points), so I've converted that to PDF, zipped it, and attached it to the thread. I don't guarantee that the wording is 100% identical, as I tweaked a few sentences after posting, but the code bits and the images should be.
Mad Poster
#6 Old 8th May 2018 at 11:15 PM
Yes, modyourpanties is down just now for me too. It was also down a few days ago, and some images in my posts weren't showing. But it came back again fairly quickly. Hopefully it will do the same again soon. If it stays down we should probably go to Site Issues.

All Sims are beautiful -- even the ugly ones.
My Simblr ~~ My LJ
Sims' lives matter!
Test Subject
#7 Old 9th May 2018 at 5:32 PM
@muridae- wow thanks for the quick response! and for uploading the pdf. So I did everything in your steps, it looked right in terminal everything looked like your screenshots- however I am still not able to have as many package files in my downloads folder as I think I should (if I'm understanding things correctly). I was able to add more- 9600 package files to approx. 13,500 in my downloads folder- but any more than that and the issues of too many files become present. Do you have any ideas as to why this would be happening??

Also just so you know, I am so appreciative of your response to my first post and for this thread! I'm new to posting here (loooooong time lurker though) and you've made me want to keep up with it. :D
Field Researcher
Original Poster
#8 Old 9th May 2018 at 7:34 PM
To be honest I've not actually hit the upper limit of what I can put in game, as I still have my old Windows disks and Windows 7 in Bootcamp so have been busily packaging up all my recolours to keep the filecount as low as possible. I also play with Pescado's antiredundancy mods in and minimal townies most of the time, which keeps the Sim numbers down. File limits are something I've mostly hit in my day job, when I have my system/database administrator hat on.

How many hoods have you got in your game? They get scanned at startup, so I think they get included in the filecount, as does everything in the Sims 2 Super Collection package. I've taken to deleting any premade hoods I'm not actually playing, because that's a few thousand files right there.

I'm reasonably certain it's not an HFS limitation, but it's still a 32-bit app so could be hitting some limits from that.

(I think I lurked here for almost a decade before posting. Had my account deleted several times for inactivity and had to recreate it more than once. Fortunately I was always able to get my login name back.)
Back to top