No operating system releases memory upon using it, but caches it once the program finishes. This actually saves time as memory blocks can be allocated in less time than loading new blocks.
However, if it's required to release memory, it can be performed via a few commands.