I cannot claim to be an expert on Linux memory management, but I do know that eddy is absolutely right. When Linux no longer needs a block of memory, it does not simply release that memory; Instead, it keeps hold of the memory for the application that used it in case that particular block needs to be used again.
However, as soon as any other applications need more memory, Linux will immediately give up that memory that has been cached to the other application. It does increase performance because it doesn't have to constantly re-allocate memory to an application, as it keeps some aside for the future.
The best way to find out how much memory you *actually* have available is using the "free" command. On the top row is the free and used memory, but this includes all cached and buffered memory (also indicated on that row). The second row (+/- buffers/cache) shows how much memory is really being used and is available, and this is simply the figures from the top row with all buffered and cached memory subtracted from it. So:
total used free shared buffers cached
Mem: 1036048 850920 185128 0 40356 702972
-/+ buffers/cache: 107592 928456
shows that 850,920KB of memory is being used, but 40,356KB of it is buffered and 702,972KB is being cached. That means the actual memory used is used - buffers - cached, which is 850920 - 40356 - 702972, which is of course 107,592KB.
So Linux would gladly give up that extra 702MB of memory for any application that requests it, and would simply discard the buffers and/or cache that it had.
The only time to get worried is when the buffers and cached figures are very low, and used is very high, meaning almost all of the memory is actually in use and active.
Sorry if this post seems a bit long-winded