Fixed memory leak in OI cache caused by lot of queries