[tf.data] Fix a memory leak when an iterator is reinitialized many times in a session.
authorDerek Murray <mrry@google.com>
Wed, 7 Feb 2018 01:37:02 +0000 (17:37 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 7 Feb 2018 01:40:47 +0000 (17:40 -0800)
commit24134b189e9846ab222ef9723d9b030dfd665ed7
treecab9c392b6951cd86e8ebb314f0fa5b40cb15cfa
parent9126444b41b243ca9bc2359d8e91a05fc0039e71
[tf.data] Fix a memory leak when an iterator is reinitialized many times in a session.

Previously, we would instantiate a new function handle for each
function in a dataset each time an iterator on that dataset was
initialized. These would only be deleted at session closure, which
could lead to an apparent leak of memory over the lifetime of session.

PiperOrigin-RevId: 184768730
tensorflow/core/kernels/data/captured_function.cc
tensorflow/core/kernels/data/iterator_ops.cc