I think you will find my answer to this post helpful.
You can try to call the garbage collection directly. See here:
Marco from EOMasters - Mastering Earth Observation -