{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1660","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1660/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1660/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1660/events","html_url":"https://github.com/tensorflow/tensorflow/issues/1660","id":143744011,"number":1660,"title":"Possible memory leak with TensorArray","user":{"login":"awni","id":1542805,"avatar_url":"https://avatars.githubusercontent.com/u/1542805?v=3","gravatar_id":"","url":"https://api.github.com/users/awni","html_url":"https://github.com/awni","followers_url":"https://api.github.com/users/awni/followers","following_url":"https://api.github.com/users/awni/following{/other_user}","gists_url":"https://api.github.com/users/awni/gists{/gist_id}","starred_url":"https://api.github.com/users/awni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awni/subscriptions","organizations_url":"https://api.github.com/users/awni/orgs","repos_url":"https://api.github.com/users/awni/repos","events_url":"https://api.github.com/users/awni/events{/privacy}","received_events_url":"https://api.github.com/users/awni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"ebrevdo","id":1794715,"avatar_url":"https://avatars.githubusercontent.com/u/1794715?v=3","gravatar_id":"","url":"https://api.github.com/users/ebrevdo","html_url":"https://github.com/ebrevdo","followers_url":"https://api.github.com/users/ebrevdo/followers","following_url":"https://api.github.com/users/ebrevdo/following{/other_user}","gists_url":"https://api.github.com/users/ebrevdo/gists{/gist_id}","starred_url":"https://api.github.com/users/ebrevdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebrevdo/subscriptions","organizations_url":"https://api.github.com/users/ebrevdo/orgs","repos_url":"https://api.github.com/users/ebrevdo/repos","events_url":"https://api.github.com/users/ebrevdo/events{/privacy}","received_events_url":"https://api.github.com/users/ebrevdo/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-03-26T19:57:30Z","updated_at":"2016-05-16T18:07:57Z","closed_at":"2016-05-16T18:07:57Z","body":"I'm not sure if the usage is incorrect (see below), but I am seeing a memory leak in cpu ram when using the `TensorArray`. Seems to be consistent regardless of device placement. I noticed this because I've been using the `dynamic_rnn`.  Happy to provide further info if needed.\r\n\r\n### Environment info\r\nOperating System:\r\nUbuntu 14.04\r\n\r\nIf installed from sources, provide the commit hash:\r\n\r\n`35c3f16f81b6a1d39a004c97160c22b73d3798e5`\r\n\r\n### Steps to reproduce\r\n\r\nRun this in a script  (I had to add `from tensorflow.python.ops import tensor_array_ops` to `tensorflow/python/__init__.py`)\r\n\r\n```\r\nimport tensorflow as tf\r\n\r\ndef ta_mem_leak():\r\n\r\n    ta = tf.python.tensor_array_ops.TensorArray(\r\n                        dtype=tf.float32, size=10000)\r\n    ta = ta.write(0, [0.])\r\n    final_outputs = ta.read(0)\r\n    return [final_outputs]\r\n\r\nif __name__ == \"__main__\":\r\n    with tf.Graph().as_default(), tf.Session() as session:\r\n        ops = ta_mem_leak()\r\n        for i in xrange(200000):\r\n            res = session.run(ops)                          \r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/219499719","html_url":"https://github.com/tensorflow/tensorflow/issues/1660#issuecomment-219499719","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1660","id":219499719,"user":{"login":"mrry","id":192142,"avatar_url":"https://avatars.githubusercontent.com/u/192142?v=3","gravatar_id":"","url":"https://api.github.com/users/mrry","html_url":"https://github.com/mrry","followers_url":"https://api.github.com/users/mrry/followers","following_url":"https://api.github.com/users/mrry/following{/other_user}","gists_url":"https://api.github.com/users/mrry/gists{/gist_id}","starred_url":"https://api.github.com/users/mrry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrry/subscriptions","organizations_url":"https://api.github.com/users/mrry/orgs","repos_url":"https://api.github.com/users/mrry/repos","events_url":"https://api.github.com/users/mrry/events{/privacy}","received_events_url":"https://api.github.com/users/mrry/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T18:07:57Z","updated_at":"2016-05-16T18:07:57Z","body":"I'm assuming this can be closed since #1691 is merged now."}}