{"action":"created","issue":{"url":"https://api.github.com/repos/asciinema/asciinema-player/issues/22","repository_url":"https://api.github.com/repos/asciinema/asciinema-player","labels_url":"https://api.github.com/repos/asciinema/asciinema-player/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/asciinema/asciinema-player/issues/22/comments","events_url":"https://api.github.com/repos/asciinema/asciinema-player/issues/22/events","html_url":"https://github.com/asciinema/asciinema-player/issues/22","id":134378125,"number":22,"title":"Memory issue with autoplay + loop","user":{"login":"daetherius","id":237597,"avatar_url":"https://avatars.githubusercontent.com/u/237597?v=3","gravatar_id":"","url":"https://api.github.com/users/daetherius","html_url":"https://github.com/daetherius","followers_url":"https://api.github.com/users/daetherius/followers","following_url":"https://api.github.com/users/daetherius/following{/other_user}","gists_url":"https://api.github.com/users/daetherius/gists{/gist_id}","starred_url":"https://api.github.com/users/daetherius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daetherius/subscriptions","organizations_url":"https://api.github.com/users/daetherius/orgs","repos_url":"https://api.github.com/users/daetherius/repos","events_url":"https://api.github.com/users/daetherius/events{/privacy}","received_events_url":"https://api.github.com/users/daetherius/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-17T19:33:59Z","updated_at":"2016-03-01T10:05:04Z","closed_at":"2016-02-28T14:40:19Z","body":"Some of our users were reporting that our site was crashing in their Chrome browsers after some minutes on the homepage. I noticed memory consumption in that page went above 1GB before the tab crashed.\r\n\r\nWe found the cause to be the asciinema-player. It was configured with autoplay and loop options enabled. Disabling the loop option seems to be a workaround, but maybe you'll want to look for any memory leak issue in your code.\r\n\r\nChrome 48.0.2564.109 (64-bit)\r\nOSX 10.11.3"},"comment":{"url":"https://api.github.com/repos/asciinema/asciinema-player/issues/comments/190644250","html_url":"https://github.com/asciinema/asciinema-player/issues/22#issuecomment-190644250","issue_url":"https://api.github.com/repos/asciinema/asciinema-player/issues/22","id":190644250,"user":{"login":"sickill","id":17589,"avatar_url":"https://avatars.githubusercontent.com/u/17589?v=3","gravatar_id":"","url":"https://api.github.com/users/sickill","html_url":"https://github.com/sickill","followers_url":"https://api.github.com/users/sickill/followers","following_url":"https://api.github.com/users/sickill/following{/other_user}","gists_url":"https://api.github.com/users/sickill/gists{/gist_id}","starred_url":"https://api.github.com/users/sickill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sickill/subscriptions","organizations_url":"https://api.github.com/users/sickill/orgs","repos_url":"https://api.github.com/users/sickill/repos","events_url":"https://api.github.com/users/sickill/events{/privacy}","received_events_url":"https://api.github.com/users/sickill/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T10:05:04Z","updated_at":"2016-03-01T10:05:04Z","body":"@jrheard sure! So, I opened Chrome's \"task manager\", loaded asciicast page with loop on and observed the growing memory for this tab. Then I stopped playback and noticed that memory is no longer growing but the CPU usage is ~60% for this tab. So I went to dev tools, and created CPU usage profile (just went to Profiles and hit \"Start\" there). It showed me a list of functions that were observed to be running by profiler. I chose the one with the highest % next to it. It was from core.async so I kept expanding the call tree and at about 4th or 5th level, after getting through all core.async/clojure.core calls I got to a function from my namespace. The line number pointed me to a line where I start `(go ...)` block. Then I just analyzed this function and few others that call it and realized that I used core.async' sliding-buffer (I had a reason for that), which is non-blocking buffer, meaning that it's not enough to stop reading from this channel to stop (block) the producer (which in my case was still running even after the playback was stopped)."}}