If I understand correctly, using weak references will help clean up the Java objects once GC kicks in. In case of kv-store likes rocksDb, the Java iterator is just a JNI interface to the underlying C iterator, so we need to explicitly invoke close to release the in-memory snapshot data, which can be large and accumulated quickly if it's not released when not in use. Maybe I am missing something as you suggested here, but looks to me using weak references might not help in this case.
I understand your concern, and I think you might misunderstood what I meant. I am totally for working hard for best user experience, and I think the current API provides a good example of that. That's also the reason I am implementing a runner here. I am just proposing an extra API to expose an iterator that can be closed when not needed, that way the users can use this feature to iterate through large state that doesn't fit into memory. I believe this is also a pretty general use case and it's better to have support for it. I am actually arguing this will be a better user experience to add this extra API since more users can benefit from it.