Cities: Skylines

Cities: Skylines

188 ratings
Page file - Setup, Explanation, and Guide V2.2
By snowflitzer
Hello folks,

This is a guide on how to setup a page file on Windows, MacOS and Linux.

What is a page file?
A page file/swap file is used by the Operation System (OS} to keep your main RAM free from assets you don't use in the game.
The more assets you subscribe too, the more RAM/page file is needed.
(*** page file on Windows, Swap file on Linux and MacOS)

How many assets can I install on (xx)GB RAM?
It depends on the size of the assets. The game runs on the Unity engine, which loads all the assets directly into the RAM on game load, as an example an asset using 100mb (steam page) it will use 100mb. Some skyscrapers I have in my collection are far to big if I load all my 400 of them I need more RAM. If you subscribe to a lot of smaller items you can subscribe to much more.
Unfortunately, only when you load the assets you see how much you use if you use Loading Screen Mod (LSM).

As an average rule of thumb for Asset/DLC}
8GB RAM: Base game
16GB RAM: Base game + 100 assets, 1-2 DLC's
32GB RAM: Base game + 500 assets, 5-10 DLC's
64GB RAM: Base game + 2000 assets, 15 DLC's
128GB RAM: Base game + 4000 assets, All DLC's !? ---> Keep in mind that an asset with a large mesh can easy fill up your RAM e.g. skyscrapers!

If you want a good running Cities Skylines you should set up your page file manually.

If you don't believe that you need a page file that is fine, just skip this guide


German translation
11
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hello folks,

It is always funny how people say you do not need a pagefile.

What is a pagefile?
A pagefile is a virtual memory RAM that helps the OS (Operation System) with additional RAM.
When a program starts, the OS will only put items in your real RAM if it is absolutely needed!

That means an asset e.g. a station is not needed in the eyes of the OS and could be put into the pagefile. The OS does this to keep the load on the real RAM as low as possible.

The pagefile has to do how an OS works and it is the same for Windows, MAC OS, and any Linux distro. The pagefile has nothing to do with Cities Skylines, it has everything to do with the Operation System.

If you want a good running OS it is preferable to help it with setting the pagefile manually.

After we still have people arguing about this, here is the technical explanation by Microsoft:
https://support.microsoft.com/en-gb/help/4055223/memory-allocation-errors-can-be-caused-by-slow-page-file-growth

Here's a summary of what is states for those who don't want to read all the details.
Originally posted by Microsoft:
Symptoms
Applications that frequently allocate memory may experience random “out-of-memory” errors. Such errors can result in other errors or unexpected behavior in affected applications.

Cause
Memory allocation failures can occur due to latencies that are associated with growing the size of a page file to support additional memory requirements in the system. A potential cause of these failures is when the page file size is configured as “automatic.” The automatic page-file size starts with a small page file and grows automatically as needed.

The IO system consists of many components, including file system filters, file systems, volume filters, storage filters, and so on. The specific components on a given system can cause variability in page file growth.

Older Windows:
https://support.microsoft.com/en-au/help/2160852/ram-virtual-memory-pagefile-and-memory-management-in-windows

64-bit Windows
https://docs.microsoft.com/en-us/windows/client-management/determine-appropriate-page-file-size

and yes the minimum amount is 4096 and not 2500! My mistake.



Data Sizes
bit
byte
Kilobyte
Megabyte
Gigabyte
bit
1
8
8,192
8,368,608
8,589,934,592
Kilobyte
8
1
1,024
1,048,576
1,073,741,824

just to be lazy I call a Gigabyte 1mil which has 1000MB
so if I want a 32GB page file I need to put it as 32000 (MB) into the box

as 32GB was too small for me, I updated it to 34GB

There is a mod that allows you to check the actual pagefile consumption during play MonitorIt!

Set Game Memory to "active":








The relevant value is "used virtual memory":












You also might want to check out the size of your pagefile during game, while your other typical background applications are running. Usualy the pagefile is to be found on the drive where the OS is installed. You might need to adapt the file browser view options to see it.

It is up to you to decide your pagefile size. Obviously it should be something bigger than your pagefilesize during play prior following this guide. This will allow you some growth.

As a rule of thumb round it up to a factor of your RAM size, e.g. 1x RAM size, 2x RAM size or even 3x or 4x times, depending on your RAM situation.
The bottleneck
As you can see in the performance overview, the adaption of the page file following this guide speeds up the loading.

So, what makes the difference, what is the bottleneck that slows down things if we don't take care of it?

Standard OS settings are for standard use cases. Playing CS is for some aspects above standard, one of them the amount of data involved, which can be pushed by subscribing to assets and mods.

In a standard scenario, it would be preferable if the OS allocates only as much space as needed to the page file, to keep the amount of blocked disc space low. The standard configuration follows this by allocating only small portions disk space - 4096 kb - to the page file.

In a standard scenario, this action takes only a few resources from the system and can only hardly be noticed.

But when loading Gigabytes of data, like you do when starting a CS game, 4096 kb is a drop in the ocean.

This results in the OS allocating 4096 kb, the game fills them in milliseconds, the OS notices that the page file is out of space and allocates another 4096 kb. And this repeats over and over again.

Now, the amount of resources needed to manage the page file sums up to an amount, which is very well noticeable.

Setting a fix page file completely removes the need to adapt the page file during the game load (and in general) and all we need to "pay" for this, is giving away a fixed amount of disc space - for when we are not playing, cause when we play, we will need that space anyway.
Improvements thanks to the pagefile
Own testing

What
Assets
Mods
Time
pagefile
Laptop, 8GB, 1 HD
1000
20
45:00
0
Laptop, 8GB, 1 SSD, 1HD
1000
20
17:00
24000
Laptop, 16GB, 1 SSD, 1HD
1500
40
3:00
30,000
Laptop, 16GB, 1 SSD, 1HD
1500
40
3:00
30,000
Laptop, 16GB, 1 SSD, 1HD
3783
98
8:00
34,000

Feedback from users who followed the guide

What
Assets
Mods
Time
pagefile
Tower, 64GB, 1 SSD, 1HD
7278
110
29:00
auto @ 9 GB
Tower, 64GB, 1 SSD, 1HD
7278
110
18:00
64000

Feel free to submit your improvements!
How to set up the pagefile in Windows
How you do that?

--> I found a shortcut for the Adv Settings: c:\windows\system32\systempropertiesadvanced.exe

  • Go to your search bar and type Control Panel, hit enter

  • In the Control Panel look for "System", double click on it




  • In the system, you see on the left side "Advanced system setting", click on it





    ---> UAC (User Account Control) will ask you to approve it


  • System Properties window pops up
  • you should be on the "Advanced" tab
  • there are 3 options, on Performance, there is a "Settings" button, click on it



  • there is another pop up with "Performance Option"
  • Click on the "Advanced" tab



  • you find 2 options, the bottom one says "Virtual Memory" and there is a "change button"



  • Setting the pagefile
    - The top option leave unticked
    - Then there are 3 options: - Custome size, System managed size, and no paging file.
    - Select Custome size: Set in minimum and maximum the same number *1
    (can but double, triple or even more than your real RAM be *2


*1 If you don't define your pagefile the OS will do it for you. That is what slows it down.

To make it efficient and fast, set the minimum and the maximum field to the same amount.

*2) If you allocate space for your pagefile, keep in mind that this space is taken away from your SSD/HD, meaning you lose that space permanently.
===> If you remove the pagefile settings you will get the space back you allocated.

As a guidance use 2x, 3x, or 4x times your RAM as size for your pagefile. That means if you have 16GB RAM, make pagefile 32GB or 48GB RAM.


--> click ok
--> click apply (----> keep in mind you need to reboot your computer now before the pagefile is setup!)
How to set it up on a MAC.
For macOS, you don't do anything to set up a page file. The system decides what memory gets swapped to disk and allocates the page file space as needed.

macOS does not use a preallocated partition for the page file store. Instead, it uses all of the available free disk space on the MacOS boot partition.

--> When more page file space is needed it grabs more of the free disk space and releases it when it's no longer needed.

One issue with this approach is that if you fill up your macOS boot disk then there is no free space to use as a page file. I

If you run into problems with "out of application memory" errors, check your boot disk and see if is full.

Try deleting some files or moving them to another partition to create some free space.

Thank you @Intellection to give us this information.

https://apple.stackexchange.com/questions/399878/how-do-i-increase-size-of-virtual-memory-in-mac-os-catalina
How to set it up on Linux
here is a link from the geeks

https://www.howtogeek.com/455981/how-to-create-a-swap-file-on-linux/

Needs to be written
How to check your pagefile setup in Windows
To bring up your System Information:

You should be on System Summery and the look into the right window below the middle half and you should see this:

Risks


There could be an issue if you set your pagefile manually!

If you over-subscribe your asset & mod you may run out of space as the pagefile might be then too small.

The game will in this instance just crash. The go back to this guide and make the pagefile bigger.

Feedback
We are aware of the fact, that the explanation is simplified. Our intent is to allow non-IT-professionals to optimize their game performance. If you are a pro, if you want to work without any pagefile or are aware of technical differences between the different OS paging and swapping mechanisms, we still hope you like this guide, but admit, that you are not part of this guides target audience.

Feedback
As we are quite new to the guide business we welcome any constructive feedback.

If you like this guide please click like.

Cheers,
Snowflitzer & Sweeny


***********************************************************************************
==> I am working on an improved version of this guide. If you have input please let me know so I can incorporate them.

@@@ I finally started updating the guide and make it easier to understand :)

***********************************************************************************

P.S. Join my discord server: Cities Skylines Group - it is for chatting :)

https://discord.gg/XZJUZfChG3
182 Comments
SimplyFenske Nov 10, 2023 @ 6:51pm 
any recommendations for what value I should be entering for 32GB RAM?
Pvt. Part Nov 7, 2023 @ 1:01pm 
i think this fixed my memory issue. thank god i have a lot of space left on my drive lol
= LUMINAK = Oct 17, 2023 @ 12:16pm 
@snowflitzer Thank You Sir ! yep on my (C:) SSD !
snowflitzer  [author] Oct 16, 2023 @ 8:09pm 
The page file should be on the system drive, which is usually C. However, it does not matter as long your drive which has the page file is the faster drive!
= LUMINAK = Oct 16, 2023 @ 5:48pm 
Awesome Thx you so much !! question ..my game is installed on Data (D:) do i need to set the pagefile on (D:) also or only on (C:) ? thank you
snowflitzer  [author] Sep 28, 2023 @ 3:40am 
use the shortcut I posted: Windows and "R", then type cmd and Enter, then post: c:\windows\system32\systempropertiesadvanced.exe
snowflitzer  [author] Sep 28, 2023 @ 3:38am 
ok one second I have w11
nhykuu Sep 27, 2023 @ 8:19am 
How do you do this on windows 11? The control panel looks different and i'm lost lol
snowflitzer  [author] Aug 7, 2023 @ 3:21pm 
No, however, it is advised it is on the faster disk and with the system. But you can put it on another disk.
11:11 Aug 7, 2023 @ 8:24am 
does the page file has to be on the windows installed file since i have no space on it right now?