A much simpler solution is to have apps be cleared from the multitasking bar after they have been idle for a half hour or so (not necessarily dumped from memory, though).
Apps are closed by the amount of memory they take up while idle, starting with the largest.
iOS 4 automagically kills the oldest used app when needed as it is.
Apps are closed by the amount of memory they take up while idle, starting with the largest.