One more thing you can try: del variable once variable is not required. Examples: batch data at the end of each training loop, models once they are not needed anymore, datasets which are no longer used, and so on.