After a program terminates the RAM is returned to OS X but it will not allow other applications use any of it. It is a bug with their virtual memory. It will say there are gigabytes of inactive memory but continue to use a swap and not allocate it.
I use 8gb on my mid 2010 MacBook Pro and find that it needs to be rebooted every so often to clear the memory. Since Lion OS X likes to hog all the RAM for some reason.