{"action":"created","issue":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/3722","labels_url":"https://api.github.com/repos/nwjs/nw.js/issues/3722/labels{/name}","comments_url":"https://api.github.com/repos/nwjs/nw.js/issues/3722/comments","events_url":"https://api.github.com/repos/nwjs/nw.js/issues/3722/events","html_url":"https://github.com/nwjs/nw.js/issues/3722","id":98496446,"number":3722,"title":"GC doesnt work well.","user":{"login":"Fogrunner","id":11848318,"avatar_url":"https://avatars.githubusercontent.com/u/11848318?v=3","gravatar_id":"","url":"https://api.github.com/users/Fogrunner","html_url":"https://github.com/Fogrunner","followers_url":"https://api.github.com/users/Fogrunner/followers","following_url":"https://api.github.com/users/Fogrunner/following{/other_user}","gists_url":"https://api.github.com/users/Fogrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/Fogrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fogrunner/subscriptions","organizations_url":"https://api.github.com/users/Fogrunner/orgs","repos_url":"https://api.github.com/users/Fogrunner/repos","events_url":"https://api.github.com/users/Fogrunner/events{/privacy}","received_events_url":"https://api.github.com/users/Fogrunner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-01T01:22:42Z","updated_at":"2015-08-10T22:47:26Z","closed_at":null,"body":"hello. \r\n\r\ni'm trying to make a html5 desktop application by using NW v 12.\r\nwhile developing, i've encountered a big problem about GC.\r\n\r\nGC works inside. i've tested by using heap profiler. \r\nbut, it does not release physical memory.\r\n\r\neven i exactly released refs, they were sill held in physical memory. \r\nso, memory usage was increased gradually. finally, the app is going to be crash (out of memory)\r\n\r\nhere is my test code :\r\n```\r\n<!doctype html>\r\n<html>\r\n<head>\r\n<meta charset=\"utf-8\">\r\n<title>NW test</title>\r\n<script>\r\nvar testArray = null;\r\nfunction Alloc()\r\n{\r\n\ttestArray = new Array(100000000).join('x');\t\r\n}\r\n\r\nfunction Dealloc()\r\n{\t\r\n\ttestArray = null;\r\n}\r\n\r\nfunction CallGC()\r\n{\t\r\n\tglobal.gc();\r\n}\r\n\r\n</script>\r\n<body>\r\n<input type=\"button\" onClick=\"Alloc()\" value=\"Alloc\">\r\n<input type=\"button\" onClick=\"Dealloc()\" value=\"Dealloc\">\r\n<input type=\"button\" onClick=\"CallGC()\" value=\"CallGC\">\r\n</body>\r\n</html>\r\n```\r\nTest scenario\r\n-----------------------------------------------------------------------------------------------------------\r\n[after, pushing the button 'Alloc']\r\n\r\n![3](https://cloud.githubusercontent.com/assets/11848318/9020063/cc07257c-3834-11e5-8127-0a40228d2ce0.png)\r\n\r\n![2](https://cloud.githubusercontent.com/assets/11848318/9020064/d7ae2bf0-3834-11e5-93ca-6d8de97acc1e.png)\r\n\r\nthe memory usage of app was gained \r\n\r\n[after, pushing the button 'Dealloc']\r\n![4](https://cloud.githubusercontent.com/assets/11848318/9020060/c5f3c726-3834-11e5-9f12-0168b0d151ab.png)\r\n\r\n![5](https://cloud.githubusercontent.com/assets/11848318/9020891/3657a6d6-3862-11e5-86d9-aa9d672b974e.png)\r\n\r\n\r\nheap profiler showed it has released well. but, memory usage was still around 100 mb.\r\nit is the reason of crash. if i did this testing routine again, memory usage would be around 200 mb. \r\nim using 8 gb desktop machine. when the usage up to 8 gb, the app was suddenly closed without any error reporting. \r\n\r\n[after, pushing the button 'CallGC']\r\n\r\n![6](https://cloud.githubusercontent.com/assets/11848318/9020099/27f1b50e-3836-11e5-83e6-35e4465235e1.png)\r\n\r\nthe usage turned back stable status.\r\n\r\ndid i do something wrong. or is it not a bug?\r\n\r\nplease, help me!\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/25237381-gc-doesnt-work-well?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/comments/129637218","html_url":"https://github.com/nwjs/nw.js/issues/3722#issuecomment-129637218","issue_url":"https://api.github.com/repos/nwjs/nw.js/issues/3722","id":129637218,"user":{"login":"mscreenie","id":11147410,"avatar_url":"https://avatars.githubusercontent.com/u/11147410?v=3","gravatar_id":"","url":"https://api.github.com/users/mscreenie","html_url":"https://github.com/mscreenie","followers_url":"https://api.github.com/users/mscreenie/followers","following_url":"https://api.github.com/users/mscreenie/following{/other_user}","gists_url":"https://api.github.com/users/mscreenie/gists{/gist_id}","starred_url":"https://api.github.com/users/mscreenie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscreenie/subscriptions","organizations_url":"https://api.github.com/users/mscreenie/orgs","repos_url":"https://api.github.com/users/mscreenie/repos","events_url":"https://api.github.com/users/mscreenie/events{/privacy}","received_events_url":"https://api.github.com/users/mscreenie/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T22:47:26Z","updated_at":"2015-08-10T22:47:26Z","body":"I'll look at how my app behaves in Chrome main stream latest. Especially when handling Iframes."}}