Each time a MS-DOS application does a directory search, it consumes 1 - 2 KB of memory. If the program does repeated searches that never complete, or it never specifically deallocates the memory, memory usage continues to grow until you exit the application or it terminates.

If you have a MS-DOS program that exhibits this behavior, it needs to be re-written.