Memory for MSTS – Accessing Memory Space Beyond 2GB

There was an active discussion some time ago on the TrainSim.com forum about a means to increase MSTS performance by increasing the memory space it can access beyond 2GB — the normal limit for a 32-bit application. It is possible, and it can have surprisingly good results, particularly on a computer with limited resources due to the way Windows manages memory.

First, a little background. MSTS was originally designed to run on computers built in the late 1990’s to just after the year 2000. At the time, 512MB was a lot of memory. MSTS was programmed to work within the typical limits of computers of the day, so in its default configuration it would not try to overtax the memory management of Windows 95/98 or even XP by working within a fairly small memory space. Of course, that required low-detail graphic objects in trains and scenery — as all of the default routes and trains provided with MSTS will show. The BIN patch unlocked the ability to define a maximum memory allocation for MSTS, which enabled much more complex models to and routes to run reliably. For years now, it has been typical to run MSTS with BIN installed and the startup command line at least modified with the “MEM:xxxx” switch. This lets MSTS allocate and use up to 2GB of memory, depending on available system resources. But that’s the limit for a 32-bit application in Win32.

64-bit Windows (Except for XP-64!) allow 32-bit applications to expand into “Large Address Space” beyond 2GB if it is available because of the memory management built into Windows from Vista 64 and later. The requirements are that the computer must have sufficient memory installed so that there’s room for an application to allocate more memory addresses beyond what the system reserves for itself, and the 32-bit application has to be “Large Address Aware” by having a flag set within the 32-bit executable. With this, a 32-bit application can theoretically access up to 4GB of address space if sufficient clear memory is available.

So how does this affect MSTS? It’s possible to modify the MSTS executable to include the “Large Address Aware” flag in the executable. Working hand-in-hand with the improvements of the BIN patch, MSTS can utilize more than 2GB of memory when necessary by setting the correct parameter. There are several ways to do this; easiest is a simple application that can set or revert the correct flag. On systems with limited performance, it can improve frame rates, minimize tile and scenery loading stutters (but not eliminate them totally) and in general provide a smoother-appearing operation at lower frame rates.

As the saying goes — your milage may vary. The best performance gains appear to be for users with lower-end to mid-range computers. High-end systems with lots of memory and particularly with solid-state drives may already be running so fast in terms of reading from drives and overall memory performance that raw speed overshadows the technical gains, although the impression of overall smoothness and steady frame rates has been noted even on high-end systems. Users with mid- and lower-end systems may see more improvement because of the optimization provided by access to a large address space along with BIN. And users running 64-bit XP are excluded because large address space for 32-bit applications isn’t supported in that operating system; XP-64 restricts memory access for 32-bit applications in favor of 64-bit performance.

For the how-to and a link to the Large Address Aware utility, go to the Tutorials Section.

Comments are closed.