How to avoid OOM and DisposableGC errors