开发者

Virtual vs Physical memory leak

开发者 https://www.devze.com 2023-01-30 09:00 出处:网络
I am just having hard time understanding the difference between virutal memory vs physical memory leak from debugging .net application perspective.

I am just having hard time understanding the difference between virutal memory vs physical memory leak from debugging .net application perspective.

Can anyone elaborate this concept with example how can we have o开发者_运维百科nly one type of leak and not other one.

TIA


Virtual memory comprises ranges of a process's address-space that have been marked as available for its use. When you leak memory, virtual memory is almost always involved, since that is the only concept that most programs deal with.

Physical memory is usually consumed only when a program accesses virtual memory, for which the OS must provide physical memory to match. This rarely leaks independently of virtual memory, since it is under the control of the OS.

OTOH, a program can exercise more control over the allocation of physical memory by forcing certain virtual memory pages to remain mapped to physical memory (the mechanisms for this vary between OSes). In such cases, it is possible for a buggy program to leak physical memory.

A softer form of physical memory leak is when a program keeps touching pages of virtual memory that it doesn't logically need to access. This will keep such pages hot and stymie the operating systems efforts to keep the working set (the set of physically mapped pages) small.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号