add option to run on single handle, and add cache clearing in order to attempt to reduce memory consumption