{"action":"created","issue":{"url":"https://api.github.com/repos/koreader/koreader/issues/1352","labels_url":"https://api.github.com/repos/koreader/koreader/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/koreader/koreader/issues/1352/comments","events_url":"https://api.github.com/repos/koreader/koreader/issues/1352/events","html_url":"https://github.com/koreader/koreader/issues/1352","id":51185374,"number":1352,"title":"Memory leak when re-opening epub file via History.","user":{"login":"tigran123","id":1933903,"avatar_url":"https://avatars.githubusercontent.com/u/1933903?v=3","gravatar_id":"","url":"https://api.github.com/users/tigran123","html_url":"https://github.com/tigran123","followers_url":"https://api.github.com/users/tigran123/followers","following_url":"https://api.github.com/users/tigran123/following{/other_user}","gists_url":"https://api.github.com/users/tigran123/gists{/gist_id}","starred_url":"https://api.github.com/users/tigran123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigran123/subscriptions","organizations_url":"https://api.github.com/users/tigran123/orgs","repos_url":"https://api.github.com/users/tigran123/repos","events_url":"https://api.github.com/users/tigran123/events{/privacy}","received_events_url":"https://api.github.com/users/tigran123/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/koreader/koreader/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-12-06T15:01:06Z","updated_at":"2015-04-01T11:01:11Z","closed_at":null,"body":"Interesting problem, reproducible easily in the emulator:\r\n\r\n0. Run `watch -n 1 \"ps aux | grep luajit\" in a terminal\r\n\r\n1. Open some epub file.\r\n\r\n2. Go to History via menu (do NOT exit back to FileManager!) as it is now possible to do so.\r\n\r\n3. Open the same file from History\r\n\r\n4. Go back to step 2.\r\n\r\nNow observe in the terminal that both the RSS and the total VM size is growing slowly but surely, by about 600K from each open. This is not critical as modern devices have plenty of memory, but in principle you can crash your system (cause OOM situation) by re-opening the same file enough times."},"comment":{"url":"https://api.github.com/repos/koreader/koreader/issues/comments/88440229","html_url":"https://github.com/koreader/koreader/issues/1352#issuecomment-88440229","issue_url":"https://api.github.com/repos/koreader/koreader/issues/1352","id":88440229,"user":{"login":"chrox","id":751535,"avatar_url":"https://avatars.githubusercontent.com/u/751535?v=3","gravatar_id":"","url":"https://api.github.com/users/chrox","html_url":"https://github.com/chrox","followers_url":"https://api.github.com/users/chrox/followers","following_url":"https://api.github.com/users/chrox/following{/other_user}","gists_url":"https://api.github.com/users/chrox/gists{/gist_id}","starred_url":"https://api.github.com/users/chrox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrox/subscriptions","organizations_url":"https://api.github.com/users/chrox/orgs","repos_url":"https://api.github.com/users/chrox/repos","events_url":"https://api.github.com/users/chrox/events{/privacy}","received_events_url":"https://api.github.com/users/chrox/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T11:01:11Z","updated_at":"2015-04-01T11:01:11Z","body":"The \"leak\" is not limited to EPUB format and with valgrind I cannot trace explicit memory leaks. So probably it's from LuaJIT's GC as @hwhw suggested."}}