Performance boost for most games.

Discussion in 'Games, Gaming & Game-demos' started by harkinsteven, May 11, 2014.

  1. harkinsteven

    harkinsteven Ancient Guru

    Messages:
    2,912
    Likes Received:
    89
    GPU:
    RTX 2080 ti
    Update: Use mbk1969's utility.

    http://www.mediafire.com/download/aiudd2j3at03j12/LargePage_util.zip



    Got this from Arma's website. It works for Arma and there are benchmarks on those forums. So it proven to work but its only a minor boost. I've tested with Arma, Stalker and Wildstar. They all seem to have benefited from this. I seen longer loading times in Wildstar but that has been a stuttering mess since the recent patches. It's way more smoother now.

    It's recommend to have 64bit Windows + 8gb+ Ram


    Open notepad, copy this and save as a .reg file. Run the file and then reboot.

    To disable

     
    Last edited: May 23, 2014
    jiraya1320 and chr!s like this.
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,100
    Likes Received:
    5,997
    GPU:
    GeForce GTX 1070
    From "Windows internals":

    Large and Small Pages
    The virtual address space is divided into units called pages. That is because the hardware memory management unit translates virtual to physical addresses at the granularity of a page. Hence, a page is the smallest unit of protection at the hardware level. (The various page protection options are described in the section “Protecting Memory” later in the chapter.) The processors on which Windows runs support two page sizes, called small and large. The actual sizes vary based on the processor architecture, and they are listed in Table 10-1.

    TABLE 10-1 Page Sizes
    Code:
    Architecture | Small Page Size | Large Page Size            | Small Pages per Large Page
    x86          | 4 KB            | 4 MB (2 MB if PAE enabled) | 1,024 (512 with PAE)
    x64          | 4 KB            | 2 MB                       | 512
    IA64         | 8 KB            | 16 MB                      | 2,048
    Note IA64 processors support a variety of dynamically configurable page sizes, from 4 KB up to 256 MB. Windows on Itanium uses 8 KB and 16 MB for small and large pages, respectively, as a result of performance tests that confirmed these values as optimal. Additionally, recent x64 processors support a size of 1 GB for large pages, but Windows does not use this feature.

    The primary advantage of large pages is speed of address translation for references to other data within the large page. This advantage exists because the first reference to any byte within a large page will cause the hardware’s translation look-aside buffer (TLB, described in a later section) to have in its cache the information necessary to translate references to any other byte within the large page. If small pages are used, more TLB entries are needed for the same range of virtual addresses, thus increasing recycling of entries as new virtual addresses require translation. This, in turn, means having to go back to the page table structures when references are made to virtual addresses outside the scope of a small page whose translation has been cached. The TLB is a very small cache, and thus large pages make better use of this limited resource.

    To take advantage of large pages on systems with more than 2 GB of RAM, Windows maps with large pages the core operating system images (Ntoskrnl.exe and Hal.dll) as well as core operating system data (such as the initial part of nonpaged pool and the data structures that describe the state of each physical memory page). Windows also automatically maps I/O space requests (calls by device drivers to MmMapIoSpace) with large pages if the request is of satisfactory large page length and alignment. In addition, Windows allows applications to map their images, private memory, and page-file-backed sections with large pages. (See the MEM_LARGE_PAGE flag on the VirtualAlloc, VirtualAllocEx, and VirtualAllocExNuma functions.) You can also specify other device drivers to be mapped with large pages by adding a multistring registry value to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargePageDrivers and specifying the names of the drivers as separately null-terminated strings.

    Attempts to allocate large pages may fail after the operating system has been running for an extended period, because the physical memory for each large page must occupy a significant number (see Table 10-1) of physically contiguous small pages, and this extent of physical pages must furthermore begin on a large page boundary. (For example, physical pages 0 through 511 could be used as a large page on an x64 system, as could physical pages 512 through 1,023, but pages 10 through 521 could not.) Free physical memory does become fragmented as the system runs. This is not a problem for allocations using small pages but can cause large page allocations to fail.

    It is not possible to specify anything but read/write access to large pages. The memory is also always nonpageable, because the page file system does not support large pages. And, because the memory is nonpageable, it is not considered part of the process working set (described later). Nor are large page allocations subject to job-wide limits on virtual memory usage.

    There is an unfortunate side effect of large pages. Each page (whether large or small) must be mapped with a single protection that applies to the entire page (because hardware memory protection is on a per-page basis). If a large page contains, for example, both read-only code and read/write data, the page must be marked as read/write, which means that the code will be writable. This means that device drivers or other kernel-mode code could, as a result of a bug, modify what is supposed to be read-only operating system or driver code without causing a memory access violation. If small pages are used to map the operating system’s kernel-mode code, the read-only portions of Ntoskrnl.exe and Hal.dll can be mapped as read-only pages. Using small pages does reduce efficiency of address translation, but if a device driver (or other kernel-mode code) attempts to modify a readonly part of the operating system, the system will crash immediately with the exception information pointing at the offending instruction in the driver. If the write was allowed to occur, the system would likely crash later (in a harder-to-diagnose way) when some other component tried to use the corrupted data.
     
    akbaar likes this.
  3. -Tj-

    -Tj- Ancient Guru

    Messages:
    16,782
    Likes Received:
    1,723
    GPU:
    Zotac GTX980Ti OC
    So its kinda a mix bag, I would enable it here have 10gb free 90% of the time.. The only part that sounds a bit risky is this change a read-only allocated space to writing, etc..

    How old is this MS article? I would guess OS matured a lot by now, no? :)
     
  4. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,100
    Likes Received:
    5,997
    GPU:
    GeForce GTX 1070
    This is a book published in 2012. I think it is no big risk to launch games with large page tweak. In case of business applications or server side services or critical data flow the risk is bigger.

    Edit: And page protection is hardware+software thing.

    Edit2: After some testing I can say that most probably reboot is not needed after adding "UseLargePages"=dword:00000001 for an exe-file.
     
    Last edited: May 11, 2014

  5. thatguy91

    thatguy91 Ancient Guru

    Messages:
    6,648
    Likes Received:
    98
    GPU:
    XFX RX 480 RS 4 GB
    This has been around for a very long time, since at least XP days. Think of the old program 7-max. It died as often programs do, through lack of development not because it didn't work. Unfortunately Microsoft hasn't really improved the core of Windows, realistically all programs should be using it, but with the protections present. It's not because it's not possible, just Microsoft didn't feel the need to do such an overhaul. The read and read+write thing isn't an issue, they should just use different pages. It's something Windows is behind on, maybe Microsoft should look at implementing it on Windows 9.

    Too bad on a non-server system there is no easy way to have it automatically globally set.
     
  6. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,100
    Likes Received:
    5,997
    GPU:
    GeForce GTX 1070
    I did run Unigine Heaven v4 and Metro Last Light (D6) benchmarks with default page size and with large page size - there are no differences in FPS.
     
  7. -Tj-

    -Tj- Ancient Guru

    Messages:
    16,782
    Likes Received:
    1,723
    GPU:
    Zotac GTX980Ti OC
    Im gonna try this mostly for mmo's


    -RIFT
    -The Secret world << especially this one, seems to stutter a lot, even now on ssd.

    -x3tc benchmark just to see if it helps by poor threading.
    -COD Ghosts



    Will take some time to test all properly, gonna post back.


    Btw tnx harkinsteven :nerd:
     
  8. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,100
    Likes Received:
    5,997
    GPU:
    GeForce GTX 1070
    I guess large page will give boost for applications which do a lot of memory read and write operations in chunks bigger than 4KB. Like audio, video and photo editors. I don`t know memory load pattern of games.
     
    Last edited: May 12, 2014
  9. -Tj-

    -Tj- Ancient Guru

    Messages:
    16,782
    Likes Received:
    1,723
    GPU:
    Zotac GTX980Ti OC
    Hm when i try to import it says the specified file is not a dword registry script?


    ie

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\X3TC_Demo.exe]
    "UseLargePages"=dword:00000001


    @Win8.1.1


    EDIT: ok nvm I manually made a new key named X3TC_Demo.exe and then added this dword Uselargepages :nerd:
    [​IMG]
     
    Last edited: May 12, 2014
  10. harkinsteven

    harkinsteven Ancient Guru

    Messages:
    2,912
    Likes Received:
    89
    GPU:
    RTX 2080 ti
    My bad, fixed it now.
     

  11. -Tj-

    -Tj- Ancient Guru

    Messages:
    16,782
    Likes Received:
    1,723
    GPU:
    Zotac GTX980Ti OC
    ^
    Ok thanks :)



    And interesting, X3TC benchmark @1080p showed a difference by min & max fps

    [​IMG]

    Scene "Trade" minimum fps is by one explosion and big cpu bottleneck, sadly no difference by min fps.
    Scene "Fight" min fps happens by one explosion with lots of smoke.
    Scene "Build" is mostly empty space,but good to see a big difference here.
    Scene "Think" gpu bottleneck 90% of the time, minimum fps is cpu bound with lots of drawcalls..
     
    Last edited: May 12, 2014
  12. harkinsteven

    harkinsteven Ancient Guru

    Messages:
    2,912
    Likes Received:
    89
    GPU:
    RTX 2080 ti
    Not too shabby for just a registry tweak.
     
  13. -Tj-

    -Tj- Ancient Guru

    Messages:
    16,782
    Likes Received:
    1,723
    GPU:
    Zotac GTX980Ti OC
    yeah, but then again I did some extra tweaks by memory management too, dunno if it helped extra..

    [​IMG]


    - tried Rift and it didnt help there, had similar streaming hickups time to time..

    - Cod Ghosts, ran smoother, but then again COD devs released a new patch and that helped too a little.

    - The Secret world, ran smoother too..
     
  14. MerolaC

    MerolaC Ancient Guru

    Messages:
    3,293
    Likes Received:
    219
    GPU:
    RX VEGA 56
    harkinsteven, thank you!
    I will do some testing, specially to see if GTA IV works better or not.

    Thanks for this.
     
  15. -Tj-

    -Tj- Ancient Guru

    Messages:
    16,782
    Likes Received:
    1,723
    GPU:
    Zotac GTX980Ti OC
    btw
    IoPageLockLimit use 8192 - 64mb to get proper value. I used 16gb by me.

    SecondaryLevelCacheSize default 256kb, but sicne my cpu has 4x256kb i set 1024.


    both older "tweaks" though, but it doesnt hurt to test. :)
     

  16. evilfury

    evilfury Master Guru

    Messages:
    542
    Likes Received:
    0
    GPU:
    MSI 1070 GTX Gaming X
    boundbyflame.exe

    ???
     
  17. MerolaC

    MerolaC Ancient Guru

    Messages:
    3,293
    Likes Received:
    219
    GPU:
    RX VEGA 56
    Just did a quick test with GTA IV.

    The stuttering is gone. This did a HUGE difference in that regard.
    FPS went up a notch (5~10 more)

    Overall, great!
     
    Last edited: May 12, 2014
  18. Cyberdyne

    Cyberdyne Ancient Guru

    Messages:
    3,430
    Likes Received:
    203
    GPU:
    2080 Ti FTW3 Ultra
    Just made a sweet little AutoIt script to make things faster.
    http://www.mediafire.com/download/p8w58s5wesjl8hu/AutoLargePages.zip

    Extract folder, run AutoLargePages.exe as administrator. Type full name of the game exe, press OK. Done.
    And to quickly remove the key, run RemoveLargePages.exe (too lazy to combine scripts) as administrator. Type the name of the exe you entered before, press OK and done.
     
  19. MerolaC

    MerolaC Ancient Guru

    Messages:
    3,293
    Likes Received:
    219
    GPU:
    RX VEGA 56
    Thank you! :D
     
  20. fragba1t

    fragba1t Master Guru

    Messages:
    485
    Likes Received:
    5
    GPU:
    GTX Strix 1060 6GB
    Long time lurker here (10 years or so? ha!) Registered a while ago but never got around to posting.

    Wanted to say thanks so much for this and all the other awesome tips/advice this site has given me over the years. You guys are the best!
     
    chr!s likes this.

Share This Page