{"action":"created","issue":{"url":"https://api.github.com/repos/ThePhD/sol2/issues/284","repository_url":"https://api.github.com/repos/ThePhD/sol2","labels_url":"https://api.github.com/repos/ThePhD/sol2/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/ThePhD/sol2/issues/284/comments","events_url":"https://api.github.com/repos/ThePhD/sol2/issues/284/events","html_url":"https://github.com/ThePhD/sol2/issues/284","id":191718661,"number":284,"title":"Memory leak in sol or wrong usage?","user":{"login":"Strasser-Pablo","id":1110541,"avatar_url":"https://avatars.githubusercontent.com/u/1110541?v=3","gravatar_id":"","url":"https://api.github.com/users/Strasser-Pablo","html_url":"https://github.com/Strasser-Pablo","followers_url":"https://api.github.com/users/Strasser-Pablo/followers","following_url":"https://api.github.com/users/Strasser-Pablo/following{/other_user}","gists_url":"https://api.github.com/users/Strasser-Pablo/gists{/gist_id}","starred_url":"https://api.github.com/users/Strasser-Pablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Strasser-Pablo/subscriptions","organizations_url":"https://api.github.com/users/Strasser-Pablo/orgs","repos_url":"https://api.github.com/users/Strasser-Pablo/repos","events_url":"https://api.github.com/users/Strasser-Pablo/events{/privacy}","received_events_url":"https://api.github.com/users/Strasser-Pablo/received_events","type":"User","site_admin":false},"labels":[{"id":341288471,"url":"https://api.github.com/repos/ThePhD/sol2/labels/Maybe.Bug...?","name":"Maybe.Bug...?","color":"fbca04","default":false},{"id":307966292,"url":"https://api.github.com/repos/ThePhD/sol2/labels/Question.Arf?","name":"Question.Arf?","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false},"assignees":[{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ThePhD/sol2/milestones/8","html_url":"https://github.com/ThePhD/sol2/milestones/Bugs.Damnit","labels_url":"https://api.github.com/repos/ThePhD/sol2/milestones/8/labels","id":1936616,"number":8,"title":"Bugs.Damnit","description":"Goddamn bugs.","creator":{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":25,"state":"open","created_at":"2016-08-11T11:11:39Z","updated_at":"2016-11-25T22:07:02Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-11-25T14:58:26Z","updated_at":"2016-11-27T00:43:10Z","closed_at":null,"body":"Hi,\r\nI found a memory leak in sol however I'm not sure if its a wrong usage of sol.\r\n\r\nThe following code leak memory:\r\n`#include <sol.hpp>\r\n#include <iostream>\r\n\r\nsol::state lua;\r\nint main(int argc,const char* argv[]) {\r\n    lua.script(\"function func() return {3} end \");\r\n    sol::function func=lua[\"func\"];\r\n    sol::table a=func();\r\n    while(true)\r\n    {\r\n            sol::table b=func();\r\n            a=b;\r\n    }\r\n}`\r\n\r\nThe leak seem to come when affecting a non empty sol::table to another one.\r\nNote that having a lua variable for the a variable as lua[\"a\"] does not leak.\r\nDoes the leak come from the fact I don't use the lua stack?\r\nI found the bug by creating torch Tensor in a loop and concanating them.\r\n"},"comment":{"url":"https://api.github.com/repos/ThePhD/sol2/issues/comments/263094879","html_url":"https://github.com/ThePhD/sol2/issues/284#issuecomment-263094879","issue_url":"https://api.github.com/repos/ThePhD/sol2/issues/284","id":263094879,"user":{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false},"created_at":"2016-11-27T00:43:10Z","updated_at":"2016-11-27T00:43:10Z","body":"This is probably because to keep these objects \"alive\", we assign them to the Lua registry so that they get a unique reference ID (e.g., `func.registry_index();`).\r\n\r\nI should perhaps look into why Lua isn't collecting from the registry table: when things go out of scope we call `luaL_unref`, and if its the last reference it should trigger deletion for Lua..."}}
{"actor":{"display_login":"ThePhD"}}