Fix game stutter on Win 10 1703-1809

Discussion in 'Videocards - NVIDIA GeForce Drivers Section' started by Exostenza, Apr 3, 2018.

  1. Driller_au

    Driller_au Member Guru

    Messages:
    146
    Likes Received:
    25
    GPU:
    Zotac 4090 Airo
    Personally I would prefer xxxxMB
     
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    Do you mean you know how to purge each of standby list separately?
     
  3. AMD Ryzen R5

    AMD Ryzen R5 Guest

    Messages:
    1
    Likes Received:
    0
    GPU:
    GTX 1060 6GB
    [​IMG] Hello!
    This is my first posting.
    Since my english is not that good, I prefer to use the Google translator.
    Did the FreeStandbyMemory.bat run, but when I start Autoruns, it looks like this.
    looks like the program is not starting.
     
  4. Wagnard

    Wagnard Ancient Guru

    Messages:
    2,749
    Likes Received:
    521
    GPU:
    MSI Geforce GTX 1080
    Possibly just the Priority 0. Must test / investigate first.
     

  5. Wagnard

    Wagnard Ancient Guru

    Messages:
    2,749
    Likes Received:
    521
    GPU:
    MSI Geforce GTX 1080
    Also, I heard the issue was probably fixed with the latest cumulative update :
    6 septembre 2018 - KB4458469 (build 17134.320)

    Addresses an issue that ignores the MM_DONT_ZERO_ALLOCATION flag. This issue leads to degraded performance, and, occasionally, error 0x139 appears.

    Time to test.
     
  6. Exostenza

    Exostenza Maha Guru

    Messages:
    1,443
    Likes Received:
    791
    GPU:
    MSI 4090 GT
    I've had fluid game play without any fix applied with that update. So far so good.
     
  7. Exostenza

    Exostenza Maha Guru

    Messages:
    1,443
    Likes Received:
    791
    GPU:
    MSI 4090 GT
    Look like 1809 is officially out! I hope we get some new drivers for WDDM 2.5 that don't destroy everything like the last change over to 2.4 did. Anyone interested in the official ISO for Win 10 x64 1809 can download it here and let us know it is for gaming. I might upgrade today just for the WMR improvements but am a bit hesitant.
     
  8. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    @Wagnard I started to test CreateMemoryResourceNotification API, but I failed to stress global memory. Do you know ways to "eat" RAM?
     
  9. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    I will wait until NVIDIA releases next drivers (supposedly with support of 1809).
     
  10. Exostenza

    Exostenza Maha Guru

    Messages:
    1,443
    Likes Received:
    791
    GPU:
    MSI 4090 GT
    Use a linlpack stress test or something like prime95. I know on the Intel burn test you can select maximum memory and it will fill it right up. Might not be what you're looking for but it is one way. Also, I guess you could just open a million Chrome tabs, lol.
     

  11. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    Will try this one - TestLimit64 from SysInternals suite
    https://blogs.msdn.microsoft.com/vijaysk/2012/10/26/tools-to-simulate-cpu-memory-disk-load/

    Update: This memory stress worked... Good.

    @Wagnard @AveYo You can use this tool to test the available memory treshold kick in:
    Testlimit64.exe -d -c NNNN
    where NNNN - megabytes to leak. You see in Resource monitor or any other app with memory info how many MB available and you execute this Testlimit64.exe to leak so that needed test value of available RAM remains. For example, you have 6000MB of available memory, so you execute "Testlimit64.exe -d -c 5600" to leak 5600MB so that only 400MB remains.
    After Testlimit64.exe does the leak it prints something (am on Russian locale so it was not readable) and waits. You can break its waiting with <Ctrl>+<C> and all leaked MBs return back to available.
     
    Last edited: Oct 2, 2018
  12. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    @Wagnard CreateMemoryResourceNotification API works, but I spent too much time at work doing actual work :(, so I will continue to test the treshold value tomorrow. Looks promising.
     
    Wagnard likes this.
  13. Wagnard

    Wagnard Ancient Guru

    Messages:
    2,749
    Likes Received:
    521
    GPU:
    MSI Geforce GTX 1080
    Since 17134.320 (1803) fixed the issue, I will slow down develeopement of the app.
    1709 user are not fixed and may still need it.
    nice, keep us posted with your findings.

    Edit : 1 on my friend told me the stutter isn't fixed with 17134.320
    Look like the tools are still needed.
     
    Last edited: Oct 2, 2018
  14. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    According to RAMMap (tab "Priority Summary")
    when you call
    Code:
        int MemoryPurgeStandbyList = 4;
        NtSetSystemInformation(SystemMemoryListInformation, ref MemoryPurgeStandbyList, Marshal.SizeOf<int>());
    
    all standby lists are purged
    when you call
    Code:
        int MemoryPurgeLowPriorityStandbyList = 5;
        NtSetSystemInformation(SystemMemoryListInformation, ref MemoryPurgeLowPriorityStandbyList, Marshal.SizeOf<int>());
    
    only standby list of priority 0 is purged.

    Also note this "Marshal.SizeOf<int>()" - MS states that the form "Marshal.SizeOf(MemoryPurgeStandbyList)" is deprecated now and can go away any new release of .Net
     
  15. Wagnard

    Wagnard Ancient Guru

    Messages:
    2,749
    Likes Received:
    521
    GPU:
    MSI Geforce GTX 1080
    What would you use instead?
     

  16. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    In old code we used this "MarshalMarshal.SizeOf(MemoryPurgeStandbyList)" - with actual variable as parameter. In new code they tell to use "Marshal.SizeOf<int>()" instead - generic method with type of variable. Sorry my awkward English.


    I managed to retrieve SYSTEM_MEMORY_LIST_INFORMATION structure with NtQuerySystemInformation:
    Code:
            [DllImport("ntdll.dll", SetLastError = true)]
            static extern UInt32 NtQuerySystemInformation(int InfoClass, ref SYSTEM_MEMORY_LIST_INFORMATION Info, int Size, out uint Length);
    
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct SYSTEM_MEMORY_LIST_INFORMATION
            {
                public UIntPtr ZeroPageCount;
                public UIntPtr FreePageCount;
                public UIntPtr ModifiedPageCount;
                public UIntPtr ModifiedNoWritePageCount;
                public UIntPtr BadPageCount;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
                public UIntPtr[] PageCountByPriority;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
                public UIntPtr[] RepurposedPagesByPriority;
                public UIntPtr ModifiedPageCountPageFile;
            }   
            ...
         
            int SystemMemoryListInformation = 0x0050;
            SYSTEM_MEMORY_LIST_INFORMATION MemoryList = new SYSTEM_MEMORY_LIST_INFORMATION ();
            uint resultSize;
            int res = (UInt32)NtQuerySystemInformation(SystemMemoryListInformation, ref MemoryList, Marshal.SizeOf<SYSTEM_MEMORY_LIST_INFORMATION>(), out resultSize);
            if (res != 0)
            {
                Console.Error.Write("Error in NtQuerySystemInformation: {0}", Marshal.GetLastWin32Error());
                return 3;
            }
            Console.WriteLine("List information:\nZeroPageCount={0,12}\nFreePageCount={1,12}\nModifiedPageCount={2,12}\nPageCountByPriority[0..7]={3}\n",
                    MemoryList.ZeroPageCount, MemoryList.FreePageCount, MemoryList.ModifiedPageCount, string.Join(",", MemoryList.PageCountByPriority));
    
    Fields are in pages. Information is confirmed by RAMMap.
    Field PageCountByPriority - is array of standby lists.
    Field RepurposedPagesByPriority - is array of repurposed lists (but I don`t remember what are they).
     
    Last edited: Oct 3, 2018
  17. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    Now I can state the correlation between "Memory" performance counters and stanby lists in RAMMap:

    Standby Cache Core Bytes = standby list priority 7
    Standby Cache Normal Priority Bytes = standby list priority 5
    Standby Cache Reserve Bytes = summary of standby lists priorities 0-4

    PS And standby list priority 6 is always 0...
     
    Wagnard likes this.
  18. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,044
    Likes Received:
    7,380
    GPU:
    GTX 1080ti
    Aida64 stability test
     
  19. BuildeR2

    BuildeR2 Ancient Guru

    Messages:
    3,219
    Likes Received:
    443
    GPU:
    ASUS 4090 TUF OG OC
    Very interesting to follow, since I'm still on 1709 for now. Keep up the awesome work, guys. :)
     
  20. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,646
    Likes Received:
    13,648
    GPU:
    GF RTX 4070
    Research and development is fun, BUT have you guys (who affected by this issue) tried to configure Prefetch and Superfetch?
    In registry key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" values EnablePrefetcher and EnableSuperfetch can be:
    • 0 - disable
    • 1 - enable for apps, disable for boot
    • 2 - disable for apps, enable for boot
    • 3 - enable for apps, enable for boot
    Plus you can clean Superfetch "database" - all files in %SystemRoot%\Prefetch folder. (But I suspect it needs the stopping of Superfetch service.)

    Plus, execute in elevated PowerShell (https://docs.microsoft.com/en-us/powershell/module/mmagent/disable-mmagent?view=win10-ps)
    Disable-MMAgent -ApplicationLaunchPrefetching -ApplicationPreLaunch

    Imo, Superfetch looks like main suspect in this issue with growing standby lists.
     

Share This Page