Sign in to follow this  
Faelandaea Dravin

Why Doesn't FSX Use Physical Memory?

Recommended Posts

Years ago I was a crazy avid FSX simmer, and I played it with literally tons of add-ons with absolutely no issues at all.  Then real life happened (A GOOD kind of happened - career related :) ), and I left my computer's side for almost 5 years to travel.  Now I am back, and have even better hardware than I had last time.  I reinstalled only a fraction of the add-ons that I used to use, and am all of a sudden getting OOM errors.  The one main difference, I am using Steam edition instead of my DVD copy.

 

After multiple hours of searching Google and trying my best to figure out my memory issues here, I now completely understand the concept of Virtual Memory.  okay ... I get it ... Even though I have 24GB of memory, FSX is for some reason designed to use Virtual Memory BEFORE using Physical memory.  My question is ... does anyone know WHY it is this way?  THAT is the one thing I cannot find an answer to anywhere is why FSX is designed to NOT use physical memory at all.  I am in process explorer cruising in the PMDG 737 NGX as we speak, and my virtual size is a whopping 3,461,960 K ... yet my working set, which is my PHYSICAL memory ... FSX is only using 1,961,540K.  

 

Okay, so I figured ... "Wait am I out of physical memory? Is FSX is being forced to use Virtual disk space???"  That's wen i Googled and found that this is not the case.  In fact FSX is purposefully trying to IGNORE physical memory and ONLY use virtual space.  And since it can NOT use more than 4 GB, I am literally sitting here within 500 MB of crashing due to OOM when my PC has plenty of physical memory available.  Yet looking at my actual physical memory on my computer, only 9 GB of it is being used right now, and I have 24 total.  That leaves 15 GB of memory free for other applications to use.

 

TL:DR - I am not asking what causes an OOM here.  I already get it and understand perfectly - FSX is designed to use Virtual space first BEFORE using physical memory.  Okay . so my question for this thread and discussion is: "Why is it designed this way?"  Aren't most applications designed to use Physical memory first THEN use Virtual Memory only as a last resort?

 

If this has been asked and answered, I apologize, but Google gives PLENTY of hits on "What causes OOM in FSX" but not anything as to why FSX is designed to not use physical memory at all.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

This have been asked and answered many time before. The answer is that FSX cannot use more then 4GB since it is a 32-bit application and 32-applications

are limited to the mentioned ram-usage. However with the planned releases of DTG FlightSim as well as a 64-bit P3D version, those limitations will be gone.

 

You have to have in mind that FSX is a very old software (10 years old) and that was how games were made back then.

Share this post


Link to post
Share on other sites

Plenty of 32-bit stuff on Steam but not much like FSX and the thousands of addons that push it to its knees

Share this post


Link to post
Share on other sites

It has nothing to do with virtual or physical memory.  It has to do with the way the program is compiled into its executable form.  At the lowest level, each memory location is identified by an address that the processor has to store in a "register" in order to do things with it.  At the time FSX was compiled, most processors had 32-bit registers and, like a calculator with a fixed number of digits, there is a limit to the largest number you can store in a 32-bit register - 2^32 (-1 for the purists) which is around 4 gigs.  So  32-bit program can only access 4GB of RAM, physical or virtual.  In addition Windows reserves around 1GB for its own use which is why you only have 3GB.

 

Virtual memory lets the operating system  play about with the physical memory allocated to any program.  In terms of availability, it only improves things, not makes them worse. Without it, 32-bit programs could not run on 64-bit OS's - or at most they would all only see the first 4GB of physical memory and compete for that.

Share this post


Link to post
Share on other sites

 

 


Aren't most applications designed to use Physical memory first THEN use Virtual Memory only as a last resort?

 

Nope. The vast majority of applications use only virtual memory addressing. Use of physical addresses in an application is known as real address mode and is rarely used.

 

The operating system takes care of mapping virtual memory to physical memory as needed, which is more efficient. That's why your program's working set is smaller than VAS.

 

The application doesn't use virtual addressing and then at some point switches to physical, it only uses virtual addresses. The OS deals with figuring out when and where to associate physical memory with some part of the program's virtual address space.

  • Upvote 1

Share this post


Link to post
Share on other sites

Wow.  So basically having 24GB of memory was a total waste of money then.  Well, not total waste ... it was a good sale indeed on Newegg.  I always thought I understood memory until this came up.  Guess I learned something new today.

 

As for the "asked many times before" answer ... I understand that VAM has been asked and answered on the 4GB bit many times ... as I found many posts on the matter.  I was asking about physical memory, not virtual memory, and on THAT part I never could find any posts because everyone was so focused on only discussion virtual and not physical.  THAT is why I was asking how I was asking in my original post.  However I really do appreciate your being patient and providing the answer anyway to someone who Google wasn't cooperating with  :smile: I also never heard of DTG releasing their own flightsim.  I knew they took over FSX, but didn't hear anything about a new sim in the works.  

 

I was running P3D for a while, but once Version 3 launched, it broke literally every add-on out there.  A lot of add-ons now, though, have upgraded to V3, but my better addons, such as PMDG Boeing aircraft, have to be purchased in full for P3D due to licensing limitations.  Later on down the road I hope to be able to fork out 140 bucks to use the AC in P3D, but for now I am going to hold off and see what comes of that DTG release that BuboBubo mentioned.

 

I do think i stumbled on something - though i am not sure what.  During my flight at cruise I opened Nvidia control panel and found that it was forcing anti-aliasing.  FSX is not designed for that sort of processing.  Though I also read that running in DX10 mode is supposed to help also, but it breaks most addons to do so.

 

I did just manage to fly into KDEN with no OOM crash, even though FSUPIC was going nuts with low memory alerts flying out of SFO.  I am hoping that the Nvidia tweaks I made during the trip were the cure.  Granted Process Explorer still says I am at 3.7 GB ... so fingers crossed I make it back into SFO.

Share this post


Link to post
Share on other sites

 

 


Wow. So basically having 24GB of memory was a total waste of money then

 

Have a shot at X-plane!  Freeware heaven at the moment, too.

Share this post


Link to post
Share on other sites

Wow. So basically having 24GB of memory was a total waste of money then.

 

Well, not a total waste.  Having the extra memory allows programs that may be running at the same time as FSX to grab their own chunk of virtual memory, rather than forcing FSX to share its 4GB.

Share this post


Link to post
Share on other sites

And Windows can use it as disk cache.

 

Cheers!
 

Luke

Share this post


Link to post
Share on other sites

 

 


Later on down the road I hope to be able to fork out 140 bucks to use the AC in P3D, but for now I am going to hold off and see what comes of that DTG release that BuboBubo mentioned.

 

I hope you're not in a hurry, it will be many months before DTG's sim will ship and then it's likely to be very rough around the edges, and so many more months or longer before it starts to look like a mature product. No telling when addon devs will get on board as that depends on many things like sales of the platform, SDK availability and capabilities, what percentage developers get to take home from DLC sales etc.

 

In any case we're going to have more and more 64-bit choices for flight sim so I'm sure your 24GB will not go to waste.  :smile:

Share this post


Link to post
Share on other sites

Our modern windows OS has a subsystem called WOW64.  From the viewpoint of FSX or other 32 bit apps, it appears that the program's interface to the OS (ntdll) is the same as on a 32 bit OS.  But WOW64 allows the program's communication to the OS to pass seamlessly through to the full 64 bit OS which is what actually controls the memory management for the OS and all programs running on it.  The memory manager for Win 7 and up is pretty sophisticated and in general trying to tweak it through various performance tweakers probably isn't going to accomplish much.  As stated previously, physical memory that is not allocted to the OS or running programs is not "wasted"; it is allocated as a system cache.

 

My understanding is that FSX makes large use of memory-mapped file I/O to access its data files.  I believe (but can't prove this) that the "system cache" is probably holding a percentage of the files in (physical) memory,  so when FSX needs to access them its just a matter of setting the memory locations rather than needing to actually do a disk-read.  I'm not sure if it is possible to prove this using procmon or similar tools.

 

I suspect a bigger problem for FSX is that it doesn't do its own memory (VAS) management very well and needs to do a better job of garbage collection, though probably the Steam version was tweaked in this area.

 

scott s.

.

Share this post


Link to post
Share on other sites

I hope you're not in a hurry, it will be many months before DTG's sim will ship and then it's likely to be very rough around the edges, and so many more months or longer before it starts to look like a mature product. No telling when addon devs will get on board as that depends on many things like sales of the platform, SDK availability and capabilities, what percentage developers get to take home from DLC sales etc.

 

In any case we're going to have more and more 64-bit choices for flight sim so I'm sure your 24GB will not go to waste.  :smile:

I'm definitely not in a hurry.  

 

I did have someone ask me the other day why I like so much eye candy in the sim.  Truthfully ... I fly in real life.  If I want to practice flying, I go out to the airport and hop in the 172 or the DA20 (I hate that thing ... but the 172 isn't always available).  I use FSX to dream ... to "travel" and explore places I will probably never get to visit in real life.  So things like NL2000, VFR Germany, and Megascenery really help me to do that.  :)

 

Anyway, I did just ditch a lot of add-ons that were not DX10 compatible and switched the DX10 preview "ON".  The result was that I took almost a full gig out of my VAS.  Granted ... I also had to delete my AI traffic to do this, and I am currently looking at Traffic 360 since my others are not DX10 capable (Ultimate Traffic, mainly and WOAI).  I imagine that will pounce it back 500 MB bringing it back into the 3.5 range in VAS.  I also noticed that the NGX seems to use a LOT more resources than the 777.  If I load up the NGX I can max out the VAS really quickly while the 777 uses almost 400-600 less on average.

 

I checked out the info on DT's FS.  That flight school looks cool to check out, but their full FS has no info, meaning that "scheduled to release in 2016" ... I've learned from "The Division" and a few other titles that until it is released, then there is no ETA and any ETA given is just marketing BS.  Due to the lack of trailers and teasers for their full FS, the earliest we can expect to see such a title is more likely going to be 2018.  

 

Now, to balance out what probably sounds like me trash-talking, I am actually very honestly excited to hear about this, and will definitely have my wallet open when it does release.  It looks like it is going to be aimed at Windows 10, DirectX 12 and 64 bit ... all VERY exciting and VERY much needed for those of us in the FS community.  I am also very excited because I have their Train Simulator, and I know they are a friendly company for allowing third party add-ons.  So I am confident we will see this in their new FS.  Just imagining the possibilities for PMDG, Captain Sim, Orbx and others on such a platform ... just mouth drooling indeed.

 

OH!  And back on the OOM 32 bit topic ... I also got a PM asking me about what add-ons I have activated during these issues:

 

  • Megascenery Earth states: Colorado, Utah, Nevada, New Mexico, Arizona, California, Oregon, Washington
  • PMDG 777-200LR/F Base Package
  • PMDG 737 NGX Base Package
  • Flightbeam KDEN, KSFO, KPHX
  • Blueprint KLAX (Looking at going to FSDT for that later on)
  • Active Sky 2016 for weather
  • REX texture Direct with Soft Clouds, currently set to 512 for clouds, 1024 for airports, DXT5/DXT1 and DX10 enabled for textures.
  • TrackIR 5 ... not an FSX addon but since I use it connected to FSX I consider it a factor in performance.

I have yet to reinstall them but I also have a ton of GA airports for the USA from ORBX, A2A Cessna 172, and the Aerosoft Twin Otter Extended.  I just haven;t reinstalled these because lately I have been focused on airliner operations while in FSX and whenever I need a GA fix I just go flying in real life.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this