Jump to content

DCS use of Pagefile


Recommended Posts

Then where are the improve and optimization in this game ?.Buy and Buy more hardware every time If you want enjoy this sim.

I dont see very well this bussines in the future.:cry:

 

I checked and mine is also 19gb and I am playing 2.5.5 release SP.

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Link to comment
Share on other sites

  • 1 year later...

 

 

There have been some really good explanations of what the windows page file does.  

We also have a lot of people with large memory systems wondering why they still need the page file.

Why does DCS at times need the file to be there when you have plenty of memory to accommodate DCS's usage?

 

Here is the answer.

 

I'm going to use some simplistic analogies here to make this easier to understand.

Let imagine your memory as a series of mailboxes.

 

The windows memory management system will allow boxes to be dropped to disk and then later restored to physic without code even knowing it is using the PageFile.  Typically windows uses physical memory and when this run out it starts "swapping" mailboxes to disk to make room and satisfy memory allocation requests.

 

Now you ask.. why when I have all this memory does it still go to my page file.

As you use programs on your computer memory allocation come along in vastly different sizes.

With all different sizes windows and the programming languages do a lot of work to group sizes to keep different sizes together.

 

The next question you need to ask yourself is what are the requirements for a memory allocation to work?

Oddly you would think the answer would be the total free memory minus the request.

 

However, the extra detail here is that the request must be satisfied by contiguous mailboxes or address space.

Normally, with average software this isn't an issue because allocations are usually in the size of Kilobytes or Megabytes.

By grouping different size together it attempts to keep larger contiguous blocks free.

Windows can somewhat move some things around and satisfy the request also.

 

However, when a program needs access to really really big resource... like say a large texture file or decompression buffer for that large file.

If the developers were being a little too aggressive, its possible they may request a very large contiguous block of memory.

 

The difficulty here is that there needs to be a contiguous set of mailboxes that can satisfy this request.

However, with other DCS code in the background ( LUA script I'm looking at you ) making swiss cheese of memory it is easy for a large allocation like this to fail.

 

Even though you have 4 or even 8 gigabytes of memory available you may not have 1 gigabyte of contiguous memory/mailboxes/ address space available.

( Please keep in mind, I don't know the actual amounts of memory DCS requests but you can imagine they are big )

 

So, along comes the Page File to the rescue.

 

First thing to note is that windows will not want to use the page file unless software forces it to or it runs out of memory.

If you have lots of extra memory it wont be used leaving it free from fragmentation.

All that SwapFIle address space/mailboxes can be made contiguous and right next to each other which means allocate able in a single chunk.

 

Now, the pain is that SwapFIle allocation involves disk or SSD which is slower than RAM.

However, I will mention that it is really using the swap file to get the contiguous mailboxes or address space.

As the memory is used, it will be brought back in to physical and after a slight hiccup things will smooth out.

 

Realistically, this was a windows accounting trick to get the contiguous address space.

You do have the physically RAM and windows will be good enough to bring everything back in as its used.

 

So this is why having the file gets you past past these little hiccups.

The disk access is the reason for the slight delay.

 

On the other side of things you could ask ED to put a little more effort into their memory allocation strategy.

Allocating very large chunks of memory in a complex system like DCS is a recipe for memory allocation failures. 

However, I will mention that even for the best software architects its easy to for this to happen when data changes.

As the data grows ( textures get bigger ), what once seemed like a reasonable amount of space can become unreasonable at a later time.

These changes first occur in data without anyone looking at the code using them and reconsidering its impact.

Kind of an undisclosed check in software.

 

Note on swap files.

 

Windows has a feature called memory mapped files.

It allows a file to be opened by making it part of the page file subsystem.

After you do this you can treat a file just like raw memory and the windows memory management system does a lot of the work for you.

It is one of the fastest ways to read and write from the disk ( only works with local files, just like the swap file ).

When software does this it will be reported as page file usage.

However you should be happy they did this because it likely saved you time.

 

Note on address space/mailboxes.

 

The address space/mailboxes we have been referring to live inside a process.

Address space is the thing that differentiates a process from a thread.

Every process gets its own address space/mailboxes and threads share their owning process address space.

The fragmentation we have been talking about happens inside a single process.

This fragmentation is isolated from other process and windows in general.

 

I hope this helps the understanding a bit.

 

 


Edited by CraZZyEddie
missing word..
  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...