A mapping is dynamic type working as a storage (not memory) key-value database
let's take the following example
contract C {
mapping(uint256 => uint256) items;
function C() {
items[0xC0FEFE] = 0x42;
}
}
The assembly code
for C function will contain :
// Storing 0x42 to the address 0x798...187c
0x42
0x79826054ee948a209ff4a6c9064d7398508d2c1909a392f899d301c6d232187c
sstore
which means we store the value 0x42
in the value corresponding to the key 0x79826054ee948a209ff4a6c9064d7398508d2c1909a392f899d301c6d232187c
which is the hash of the mapping key 0xC0FEFE
here's an interesting discussion about why mapping could not be designed for memory usage
Why (conceptually) can't mappings be local variables?