Gentle reminder: Actually, to provide a better answer for the rest of the community, please don't say something like "Do not talk about the four types of memory", as even if you know it well, there may be a thousand and one citizens of the internet arriving here hoping for a collateral answer :)
EDIT: Paging is the accurate term for the following action. swapping is used colloquially for paging, quite interchangably these days, though. swapping originally refers to moving of a program's memory space completely onto "secondary storage" (as opposed to "main storage", which is an archaic term for... RAM, in a way). The boundary between paging and swapping, is considerably blurred by windows and UNIX systems calling the paging space swaps.
And then, one must know about paging in order to understand the concept of active, wired and inactive memory. Paging means that the memory page is moved out of random access memory (i.e. the RAM) and onto the harddisk. this allows the running application to, in total, request more memory than the amount of system ram available.
Note that although paging out means a huge performance penalty to access that particular bit of information again, paging can occur in two different cases: (Quoting myself: Disadvantages of not having a swap partition)
- When there is not ENOUGH memory for all applications - in the case where this happen to a system without swapspace, it will cause failure to allocate memory for new application requesting new memory pages - and this usually result in termination of the program
- When some memory pages (memory is divided into 'pages') is used some time ago, but is no longer used now, it would be transferred on the swapfile and the remaining memory can be used to do something else which could be more useful (e.g. even caching!) - when this happen in a system without swapspace, this will result in idle pages being staying in memory. This is nothing too serious though, as we have pretty large amount of memory these days...
The four types of memory are classified as follows:
Wired: Used by an application that claims that the chunk of allocated memory must stay physically in RAM, and not swappable onto disk no matter it is recently used or not. i.e. another application may NOT request that particular trunk of memory. Examples are part of the memory utilized by the system, and that used by virtual machines.
Active & Inactive: These are memory used usually by user-mode applications, in which they are swappable onto disks. Active means that it is recently used, and Inactive means that they are not recently used. The operating system thus would swap out inactive first, and then active later if necessary.
Free memory: Memory that aren't used. They are used for other purposes such as caching of the harddisk.
If your question is in a dire situation where memory is inadequate, what sequence would the system allocate to a new application, then the sequence would be to allocate
free memory → inactive memory → active memory
In a sense, even recently used memory could be paged, The 'wired' part is what would not be paged out at all costs.
In modern systems though, it is rather unlikely that active memory got paged out as we have plenty of RAM available.