Train Simulator Classic 2024

Train Simulator Classic 2024

186 ratings
Fixing the Out of Memory Error
By Warwick Rail
The 'Out of Memory' error can be triggered by various issues, and can therefore be tackled in several ways. When combined, these measures can work together to help prevent the error occurring. Perhaps the game is trying to use your computer's onboard graphics instead of your dedicated video card. It has also been found that the 'Out of Memory' issue can be prevented by adjusting the minimum and maximum size settings of the Windows paging file. Sometimes, regularly clearing the cache and verifying your game files will help. This guide also contains advice on the Windows 10/11 Game Mode, and what to do about corrupt Workshop scenarios.
The Problem
The 'Out of Memory' error can be triggered by various issues, and very often these may have nothing to do with memory (or lack of it) and might be the result of a corrupt scenario file or some other issue. This guide will cover these various possibilities.

Whatever the reason for its occurrence, the sudden appearance of the error message can have a seriously negative impact on your enjoyment of Train Simulator.

This guide has been written to help you banish it forever.

It is perhaps the most hated message ever to desecrate the screens of people using the program. I have added a "prohibited" symbol to express my disgust and determination to stamp it out. Fortunately I seldom if ever see it these days and it has become a rarity for the many people who have followed the various recommendations set out below.

By the way, the error message itself contains an error - a broken link.

The link no longer exists.

Instead you should use the following:

Dovetail Support[]
The Multi-Part Solution
The various issues which may be causing the Out of Memory Error can be tackled in various ways, and all these steps can work together to help prevent the error occurring.
  1. Enabling Your Dedicated Video Card

  2. Hardware-accelerated GPU Scheduling

  3. Adjusting the Windows Paging File

  4. Automatically Clearing the Paging File on Shutdown.

  5. Clearing the Cache

  6. Verifying the Integrity of Game Files

  7. Turning Windows Game Mode Off

  8. Fixing Corrupt Workshop Scenarios

Don't forget that running certain other programs in the background (for example a memory-hungry web browser like Chrome) can sometimes have an adverse impact, so it is wiser to close them before running the game.

Enable Your Dedicated Graphics Card
Make sure your video card is configured so that the game uses it rather than using the CPU's integrated graphics. Otherwise your game will not make use of your video card's memory.

Here's how. In the Windows settings (might be different or not even apply for versions of Windows earlier than Windows 11), Choose System > Display > Graphics and you should see the following dialogue window. Type RailWorks in the search box and you should see the 32-bit and 64-bit versions of the game.

Click on the one you want to check, choose options and then select 'High performance.'

Then save and exit.

Also open the control panel of your graphics card and make sure it is enabled for both versions of the game (32-bit and 64-bit).

This ensures that the game will make full use of your video card's memory.

Hardware-accelerated GPU Scheduling
Turn on hardware-accelerated GPU scheduling.

With Windows 10 May 2020 update, Microsoft introduced a new GPU scheduler as a user opt-in, but off by default option. With the right hardware and drivers, Windows can now offload most GPU scheduling to a dedicated GPU-based scheduling processor.

To enable hardware-accelerated GPU scheduling using Windows 10 or Windows 11 Settings, follow this procedure:
  1. Open Settings
  2. Select System > Display tab.
  3. Locate Multiple displays
  4. Click on Graphics Settings.
  5. Select the Change Default Graphics Settings option.
  6. To enable the feature, toggle ON the button next to the Hardware-accelerated GPU scheduling.

Reboot your Windows device to apply the changes.

The Windows Paging File
Very often, the issue causing the Out of Memory Error message can be prevented simply by adjusting the minimum and maximum size settings of the Windows Paging File, which is part of the Windows operating system.

The paging file can expand the amount of system-committed memory, or virtual memory, that a system can utilise.

The paging file extends the RAM’s capacity, as it stores RAM data that has not been used or accessed lately. Additionally, operations that exceed your system's physical RAM space are automatically sent to the paging file to be stored to free up RAM. A paging file can be read as a connected chunk of data from RAM, which is much faster than reading the data from multiple locations.

All computers need a paging file, whether you have over 64 GB of System RAM, or just 4 GB, as Windows may need it for important processes that may not be immediately apparent. Train Simulator also requires you to have a paging file and, without one set, it can directly affect the smooth running of the software.

A system managed Page File will be adequate is most use cases, unless you are experiencing problems.

If you are experiencing problems, you may wish to manually configure the settings to adjust its size and placement.

As regards what settings to use for your paging file, there are several schools of thought.

  1. The Dovetail Games recommended (Microsoft documentation) method.
  2. The Mark Russinovich (Microsoft expert) method.
  3. The Fixed Paging File method.

1. The first method (which is used in this guide) completely matches that given by Dovetail Games themselves in their Train Simulator Knowledgebase. You can check this out at the following link.

Managing Your Computer's Virtual Memory (Page File) In Windows []

Under method 1, ideally your paging file size should be 1.5 times your physical memory at a minimum and up to 4 times the physical memory at most to ensure system stability. For example, say your system has 8 GB RAM. You can calculate your minimum paging file size with this equation: 8 GB x 1.5, and your maximum paging file size with this one: 8 GB x 4. The totals would be 12 GB and 32 GB of RAM respectively. Windows needs the figures in MB instead of GB and uses the binary interpretation for disk capacity, so multiply them by 1024. In the dialogue box you should enter the settings as 12,288 MB and 32,768 MB.

2. The second method recommended by Dr Mark Russinovich bases the ideal paging file size on the maximum total commit charge for the programs you like to have running at the same time. He says if you want to have some breathing room for potentially large commit demands, set the maximum to double that number.

You can check this out at the following link.

Pushing the Limits of Windows: Virtual Memory []

Mark Eugene Russinovich is a Spanish-born American software engineer who serves as CTO of Microsoft Azure. He was a cofounder of software producers Winternals before it was acquired by Microsoft in 2006. He says some feel having no paging file results in better performance, but in general, having a paging file means Windows can write pages on the modified list (which represent pages that aren’t being accessed actively but have not been saved to disk) out to the paging file, thus making that memory available for more useful purposes (processes or file cache). So while there may be some workloads that perform better with no paging file, in general having one will mean more usable memory being available to the system (never mind that Windows won’t be able to write kernel crash dumps without a paging file sized large enough to hold them).

3. The third method involves setting both the minimum and maximum paging file sizes to double the expected normal maximum commit charge. By having the minimum and maximum sizes the same, you effectively create a fixed paging file which never changes size and is less likely to become fragmented. I have tested this method, and it seems to be adequate for me. However, its effectiveness will depend on your system.

Changing the Windows Settings
Now you understand the function of the paging file (Page File), here's how to optimise it.

  1. Go to the Windows Start Menu and click on Settings.

  2. Type performance.

  3. Choose Adjust the appearance and performance of Windows.

  4. In the new window, go to the Advanced tab and under the Virtual memory section, click on Change.

  5. Deselect the Automatically manage paging file size for all drives box at the top.

  6. Select the drive with your Windows operating system installed.

  7. Click Custom and enter a size range. Suppose your system has 32 GB or RAM. Your minimum paging file size can be calculated by 32 GB x 1.5, and your maximum paging file size can be calculated by 32 GB x 4. That's 48 GB minimum and 128 GB maximum. The dialogue box needs the figures in MB, so multiply by 1024. In this example, the system has a minimum paging file size of 49,152 and a maximum size of 131,072.

  8. Leave all the other drives alone.

  9. Click Set then Ok.

That's it. Your Windows paging file has now been optimised for Train Simulator (and other games), and this should help prevent those horrible Out of Memory errors.

Automatically Clearing the Paging File
It is possible to automatically clear the Windows Paging File at shutdown.

This is optional, but some reports say this is a good way to prevent the Out of Memory error. Peter Hayes, who is somewhat of an authority on Train Simulator with years of experience, says "the reason the paging file tweak works is not due to its size change but moving it to a different part of your disk drive. Remember the Paging File retains data (corrupt or otherwise) when Train Simulator shuts down and preferably should be emptied each time Windows closes."

*Please note, in some cases this automatic method can slow down the computer shutdown/restart process.

Here are the steps:

Start Regedit. (do this by typing regedit in the Windows Search box and clicking on Registry Editor)

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

Find ClearPageFileAtShutdown from the list on the right.

Right click on it and select Modify.

Change the value to 1 to enable.

Reboot your computer.

Clearing the Cache
It has been found that clearing the cache can greatly reduce the occurrence of the OOM error.

Clear the cache either before you start playing or editing, or after you finish. I do this as a matter of routine.

You can clear the cache via the Train Simulator settings/tools menu after the game loads.

The in-game cache can become corrupted by crashes or by interrupting the loading process. If the cache has become corrupted, it may be necessary to force the game to rebuild the cache by deleting the existing cache files.

How to manually clear the cache outside of the game
  1. Close Train Simulator.
  2. Open Steam, locate Train Simulator in the Library
  3. Right-click, go to Manage > Browse Local Files
  4. Open the folder Railworks\Content
  5. Delete every file with "cache" in the name
  6. Restart Train Simulator and allow it to rebuild the cache without interruption.

You can create a batch file to do this.

Type the following in notepad (or any other text editor) and save the file as ClearCachcs.bat

del SDBCache.bin del SDBCache.bin.MD5 del RVDBCache.bin del RVDBCache.bin.MD5 del TMCache.dat del TMCache.dat.MD5 pause

Place this file in your Railworks\Content folder and run it to clear the cache manually.

You can create a shortcut to this batch file and place it on your desktop for convenience.
Verifying the Integrity of Game Files
Besides the paging file optimisation and clearing the cache, verifying the integrity of your game files can also prevent the Out of Memory error.

Verify Integrity of Game Files when you still have the OOM error or indeed any other unexplained problem..

It can be done via the Steam Library Page.

First right click on Train Simulator to bring up the dialogue, then select Properties

Now choose Local Files and then Verify Integrity of Game Files

Turning Windows Game Mode OFF
This is not directly related to the Out of Memory Error, but it can have an impact and also interfere with the smooth running of Train Simulator.

Although enabling Game Mode should usually prioritise games and minimise background tasks to improve performance, many games encounter poorer frame rates, stutters, and freezes.

In my experience, Train Simulator is one of these games, so I strongly advise you to turn Game Mode off.

Open the Start menu, select Settings, choose Gaming, Game Mode and under its settings turn Game Mode OFF.

Also under Gaming, choose Captures and make sure Background recording (Record what happened) is OFF - unless of course you actually need to do such recording.

These changes should help to improve performance and result in better and smoother gameplay for Train Simulator, and may help prevent the OOM error.

Similar advice for Microsoft Flight Simulator is given at this website:

Flight Simulator Blog - Best Graphics Settings Guide []

Fixing Corrupt Workshop Scenarios
Those who encounter the Out of Memory Error and who cannot even start the game may in fact have a corrupt workshop scenario file on their system.

It is often recommended that they unsubscribe and delete their latest subscribed scenarios one by one until they can get the game restarted.

However, methodically unsubscribing from the scenarios in this fashion is not the best cure. It is much better to identify and deal with the specific scenario(s) causing the problem. You will find your workshop subscriptions under the following folder:

Program Files (x86)\Steam\steamapps\workshop\content\24010\

The well-known community contributor Cyclone has written excellent, clear and detailed instructions on how to proceed from here, so I shall simply provide the link:

Dealing With Corrupt Workshop Scenarios []

He very kindly informs me that if anyone has questions related to the handling of Workshop scenarios to avoid corrupt scenarios, he can possibly answer those questions.

------ OTHER ------
Our TSC Guides
We have written a range of guides for Train Simulator Classic

Click the link below to access them all:

Warwick Rail's TSC Guides

Give this Guide a Thumbs Up
If you have found the above advice and information useful, please rate this guide by giving it a thumbs up - and of course don't forget to add it to your favourites.

Thank You for the 38 Awards
I would just like to say a very big thank you for the 38 generous awards people have bestowed on this guide. Your kindness is most encouraging and the awards are very much appreciated.
This guide © Copyright Warwick Rail 2020-2023, all rights reserved.

arg2yr May 20 @ 10:04am 
31- Fell in reverse Mar 26 @ 9:07am 
too much thinks to do to fix 15 yo game with 15 yo graphics. i'd rather not play, but guide is good.
received for free btw
dispatcher623 Jul 1, 2023 @ 4:39pm 
Thanks for this very handy guide!
Civil Alex Feb 12, 2023 @ 7:28am 
Com esse problema agora de 'Out of Memory Error' após usar o TS por dez anos. Fixing the OME . First time in 10 old years.
Warwick Rail  [author] Apr 13, 2022 @ 11:12am 
You are welcome William. Thank you for your kind words. I am really pleased to have been of some help.
Digit42 [HM] Apr 13, 2022 @ 10:26am 
my god warwick you are a life saver that helped me out a bunch and now i can play the game thank you thank you thank you
Warwick Rail  [author] Apr 12, 2022 @ 6:31am 
Hello Drvonwolf [hm]. May I refer you to the following guide?
Digit42 [HM] Apr 12, 2022 @ 6:26am 
when i start train sim i get to the bit where it says updating scenario database and then crashes with the out of memory thing i dont have any workshop stuff installed
Flankers Mar 20, 2022 @ 12:16pm 
All working now, deleted the JT Folder and re installed the new. Many thanks to Warwick Rail for all his help and advice :)
Warwick Rail  [author] Mar 20, 2022 @ 11:04am 
@[HolcLn.A]1stLt. Flankers. I see. So it's not a route purchased on Steam at all. It is something you purchased direct from Just Trains. In that case just delete the appropriate route folder.