Hyper-V CSV Read Cache Eating All RAM & Crashing Hosts—How to Cap BlockCacheSize?

Advait Mohammad 40 Reputation points
2026-08-20T09:21:47.1133333+00:00

High-read workloads are blowing out our Hyper-V cluster's CSV Read Cache and starving the hosts of RAM, causing node crashes. What's the best way to cap BlockCacheSize via PowerShell to stop these OOM errors?

Windows for business | Windows Server | Storage high availability | Virtualization and Hyper-V
0 comments No comments

2 answers

Sort by: Newest
  1. Harry Phan 31,780 Reputation points Independent Advisor
    2026-08-21T05:16:35.5666667+00:00

    Hello,

    The CSV Read Cache in Hyper‑V is controlled by the BlockCacheSize parameter, which defines how much host RAM is reserved for caching reads on Cluster Shared Volumes. By default, it can dynamically consume a large portion of memory, which is why you’re seeing hosts starve and crash under heavy read workloads. To cap it, you need to explicitly set the cache size per node using PowerShell against the cluster resource.

    Run this on one of the cluster nodes with elevated PowerShell:

    powershell

    Get-Cluster | Set-ClusterParameter BlockCacheSize 512

    The value is in megabytes, so in this example the cache is capped at 512 MB. You can adjust the number based on how much RAM you want to reserve for CSV cache versus leaving available for workloads. After setting it, you must restart the Cluster service on each node for the change to take effect:

    powershell

    Stop-Service ClusSvc

    Start-Service ClusSvc

    Alternatively, you can reboot the nodes during a maintenance window. Verify the setting with:

    powershell

    Get-Cluster | Get-ClusterParameter BlockCacheSize

    Keep in mind that this is a cluster‑wide parameter, so the value applies to all nodes. Microsoft’s official guidance is to size the cache conservatively in environments with memory pressure, or disable it entirely (BlockCacheSize 0) if your workloads are consistently read‑heavy and the cache is doing more harm than good.

    I hope you've found something useful here. If it helps you get more insight into the issue, it's appreciated to accept the answer. Should you have more questions, feel free to leave a message. Have a nice day!

    HP.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-08-20T09:22:06.87+00:00

    Set the cluster-wide CSV read cache limit by changing BlockCacheSize, which is measured in MiB per server.

    Use an elevated PowerShell session:

    # View current CSV cache allocation per server
    (Get-Cluster).BlockCacheSize
    
    # Example: cap the CSV cache at 512 MiB per server
    (Get-Cluster).BlockCacheSize = 512
    

    If a larger cache is currently configured, lower it to a value that leaves enough RAM for the host and VMs. For example:

    • 512 = 512 MiB per server
    • 1024 = 1 GiB per server
    • 2048 = 2 GiB per server

    Important points:

    1. The CSV in-memory read cache is for read-only, unbuffered I/O. It does not cache writes.
    2. It is most useful for read-intensive workloads such as Hyper-V and VDI.
    3. If the workload is extremely write-intensive, the cache can add overhead and should be disabled.
    4. Up to 80% of total physical memory can be allocated to the CSV in-memory read cache in supported versions, so the cache should be capped carefully to avoid starving VMs and the host.

    To make the new setting take effect immediately on newer versions, pause and resume the CSV volumes, or move them between nodes:

    Get-ClusterSharedVolume | ForEach {
        $Owner = $_.OwnerNode
        $_ | Move-ClusterSharedVolume
        $_ | Move-ClusterSharedVolume -Node $Owner
    }
    

    If the environment is Windows Server 2012 R2 or later, another documented example is:

    (Get-Cluster).BlockCacheSize = 512
    

    If the workload pattern is not benefiting from cache locality, reducing the value further or disabling the cache is appropriate. In Windows Server 2016, the default is 0 (disabled). In Azure Local and Windows Server 2019, the default is 1024 (1 GiB).


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.