Challenges and Future Possibilities for Memory Ballooning in Windows Guests #989
Replies: 3 comments
-
Ballooning in Windows is a quite simple thing. When we inflate balloon in Windows the balloon driver allocates memory from non-paged pool (RAM) , builds array of PFNs and passes this array to the host. From the Windows point of view it is normal operation when a kernel mode driver is asking for non-paged memory for its own needs. After all it doesn't make any difference if a driver uses this nonpaged memory to store some critical data or just pretends to be using this memory and passes the memory descriptors (PFNs) to the host. In both cases Windows will see the same amount of the installed memory in the system. Best, |
Beta Was this translation helpful? Give feedback.
-
@Directox01 To summarize, while the memory will be released to the host - Windows guest will still present the total memory as the initial memory was assigned to it, but the released memory will be seen as part of the used memory. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the excellent explanation! I have another quick question: I was wondering if it's what I was looking recently? #1000? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
Greetings!
I've been exploring the memory ballooning feature in both Linux and Windows guests and have observed a distinct behavior difference between the two. Specifically, while Linux guests effectively release unused memory back to the host, Windows guests seem to retain it. I recently opened an issue regarding this: #903.
I understand that Windows and Linux have inherently different memory management mechanisms, and developing drivers that deeply interact with OS internals can be challenging. However, I'm keen to understand the specific technical challenges that prevent the VirtIO balloon driver for Windows from releasing unused memory back to the host in the same manner as it does for Linux.
Are there specific aspects of Windows' memory management that make this behavior challenging to implement?
Is it a limitation of the current driver implementation, or are there deeper OS-specific challenges at play?
Most importantly, is it technically feasible to expect a solution that allows Windows guests to release unused memory back to the host in the near future?
I'd also like to mention that using KSM isn't a viable solution for us due to compatibility issues with SEV and SME. Additionally, KSM is not recommended for production use due to security concerns.
I believe understanding these challenges can provide clarity to many in the community and help set realistic expectations.
Thank you for your time and the incredible work you do!
Best regards,
Adam.
Beta Was this translation helpful? Give feedback.
All reactions