by InexorableTash » Jan 5, 2007 @ 6:43am
It's important to think about virtual memory (the total amount of memory allocated by an application) and real memory (the amount actually currently in the RAM chips, not residing on disk).
On Windows, all of an application's allocated memory (the total virtual memory) is stored on disk, with a subset in real memory. Ideally, for best performance, the amount of memory an application is actually using over time (called the "working set") is fairly small and fits in the real memory of the system with room to spare.
When chunks ("pages") of memory need to be used that are just on disk and not really in RAM they get "paged" in. When the system runs out of real memory, the in-memory chunks are "paged" to disk (really, they're just dropped out of real memory and the disk copy becomes the master). If an application does this to itself (say a system has 1GB of physical memory and the app is doing some operation that needs 2GB of memory), it's called thrashing.
However, on desktop Windows, it's very common for users to switch between apps that each want to use a fairly large chunk of memory. Say you've got 1GB of physical memory and 5 apps that each want 0.5GB of memory. As you switch between them, the 1GB gets shared between the apps in bits and pieces. As each app needs chunks moved in the system slows down as the memory is read from disks.
To make the system more responsive to users, when you minimize an application on Windows all of the app's memory is paged to disk, so it's real memory usage will instantly drop to zero. (If it's still processing and not simply idle waiting for user input them some of the memory will immediately page back in.)
There's no compression going on - you're simply seeing the OS try to make the experience better for the user who has just said "go away" to an app.