1

Both on windows and Linux machines it seems as if memory usage tops out around 80% according to resource monitors. Once memory gets around 80% disk IO starts to shoot up and I can hear the computers threshing, presumably due to heavy use of virtual memory.

It would seem intuitively that disk thrashing shouldn't happen until a machine is close to 100% memory usage, but for some reason both OS seem to treat 80% as the max memory available to allocate, and never seem to go over that value no matter how much thrashing is happening due to lack of memory.

Why is it that the other 20% memory seems reserved or unused?

1 Answer 1

4

I will speak primarily of Windows because that is what I know. But the basic principles in Linux are similar.

Windows and Linux both have advanced memory management but the principles involved are not easily understood. The OS was designed to work well but not necessarily be intuitive.

It is important to understand that if memory usage is displayed as 80% it does not mean that the remaining 20% is free and unused. In most cases it is very much in use. In my Windows 10 system memory usage is currently 40% of 8 GB. The remaining 60% is labeled as "Available" but only 44 BM of this is actually free. The large majority of available memory is on the standby list. This memory contains potentially useful data but is not currently in active use. This data can be returned to the process that owned it if it is needed. Or the memory can be reassigned for any other use as needed. This memory contributes much to good performance.

Windows and Linux will always try to maintain a reasonable value of available (but not necessarily free) memory. This is a complex process with many factors being considered. The memory manager does this by reclaiming rarely used memory from processes. This may require saving data to the pagefile. The OS knows what memory blocks have been recently accessed and which have not. The data in reclaimed memory is still available if it is needed. All of this is totally transparent to processes which have no knowledge of it.

When available memory is plentiful processes are allowed to keep whatever memory they want. But as memory usage grows the memory manager becomes more aggressive in the effort to maintain available memory. Data is written to the pagefile and other disk access is needed to reclaim memory that was previously removed. This accounts for the disk thrashing.

The memory manager tries very hard to avoid very high levels of memory usage. 100% usage would be permitted only under extreme memory pressure. Performance would would be seriously degraded long before this happens.

This memory management process has been the result of years of research, development, and testing. The goal is always to maintain overall system performance. Windows has been doing this since the introduction of NT in 1993 and Linux has done it from the beginning.

So no memory is being reserved, the memory manager is just trying to maintain a reasonable value of available memory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .