Fix out of memory error by calling garbege collection when bitmap is cleared