It takes too much memory on prolonged use. It can be made efficient by using some sort of garbage collector.