Add more verbose logging in predicate evaluation code. Close or manage cursors in locations where they should have been closed.