{"action":"created","issue":{"url":"https://api.github.com/repos/eclipsesource/J2V8/issues/110","labels_url":"https://api.github.com/repos/eclipsesource/J2V8/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/eclipsesource/J2V8/issues/110/comments","events_url":"https://api.github.com/repos/eclipsesource/J2V8/issues/110/events","html_url":"https://github.com/eclipsesource/J2V8/issues/110","id":119009123,"number":110,"title":"v8 memory release","user":{"login":"omanhom","id":13151762,"avatar_url":"https://avatars.githubusercontent.com/u/13151762?v=3","gravatar_id":"","url":"https://api.github.com/users/omanhom","html_url":"https://github.com/omanhom","followers_url":"https://api.github.com/users/omanhom/followers","following_url":"https://api.github.com/users/omanhom/following{/other_user}","gists_url":"https://api.github.com/users/omanhom/gists{/gist_id}","starred_url":"https://api.github.com/users/omanhom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omanhom/subscriptions","organizations_url":"https://api.github.com/users/omanhom/orgs","repos_url":"https://api.github.com/users/omanhom/repos","events_url":"https://api.github.com/users/omanhom/events{/privacy}","received_events_url":"https://api.github.com/users/omanhom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eclipsesource/J2V8/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"irbull","id":196883,"avatar_url":"https://avatars.githubusercontent.com/u/196883?v=3","gravatar_id":"","url":"https://api.github.com/users/irbull","html_url":"https://github.com/irbull","followers_url":"https://api.github.com/users/irbull/followers","following_url":"https://api.github.com/users/irbull/following{/other_user}","gists_url":"https://api.github.com/users/irbull/gists{/gist_id}","starred_url":"https://api.github.com/users/irbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irbull/subscriptions","organizations_url":"https://api.github.com/users/irbull/orgs","repos_url":"https://api.github.com/users/irbull/repos","events_url":"https://api.github.com/users/irbull/events{/privacy}","received_events_url":"https://api.github.com/users/irbull/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-11-26T09:57:49Z","updated_at":"2015-12-04T20:39:46Z","closed_at":null,"body":"Using the 3.0.2 linux version of my project. In the stress test, call runtime.release () method, the V8 class in the \"Map functions \" property definition is not clear, it is easy to cause the java process OOM.\r\nNow I added a clear () method in the V8 class, as follows:\r\n\r\npublic void clear() {\r\n        if (functions != null) {\r\n            functions.clear();\r\n        }\r\n}\r\n\r\nIn call runtime.release (), also call clear () , but unfortunately, the program running for some time, the Linux process takes up a lot of memory, until the machine is hung up, using the top Linux command to see the following information:\r\n\r\n![os](https://cloud.githubusercontent.com/assets/13151762/11420104/c5f7394a-9466-11e5-8ee1-369073b1afd2.png)\r\n\r\nAt the same time using jvisualvm monitoring results\r\n\r\n![jvm](https://cloud.githubusercontent.com/assets/13151762/11420129/02357552-9467-11e5-9f3f-cae59841cef6.png)\r\n![cpu](https://cloud.githubusercontent.com/assets/13151762/11420137/0bde5f60-9467-11e5-8c39-4f57222d63c9.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/eclipsesource/J2V8/issues/comments/162075961","html_url":"https://github.com/eclipsesource/J2V8/issues/110#issuecomment-162075961","issue_url":"https://api.github.com/repos/eclipsesource/J2V8/issues/110","id":162075961,"user":{"login":"irbull","id":196883,"avatar_url":"https://avatars.githubusercontent.com/u/196883?v=3","gravatar_id":"","url":"https://api.github.com/users/irbull","html_url":"https://github.com/irbull","followers_url":"https://api.github.com/users/irbull/followers","following_url":"https://api.github.com/users/irbull/following{/other_user}","gists_url":"https://api.github.com/users/irbull/gists{/gist_id}","starred_url":"https://api.github.com/users/irbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irbull/subscriptions","organizations_url":"https://api.github.com/users/irbull/orgs","repos_url":"https://api.github.com/users/irbull/repos","events_url":"https://api.github.com/users/irbull/events{/privacy}","received_events_url":"https://api.github.com/users/irbull/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T20:39:45Z","updated_at":"2015-12-04T20:39:45Z","body":"I can produce a leak with the following: \r\n```\r\n    @Test\r\n    public void testStressTestV8Instances() {\r\n        for (int i = 0; i < 100000; i++) {\r\n            System.out.println(\"Creating runtime: \" + i);\r\n            V8 runtime = V8.createV8Runtime();\r\n            for (int j = 0; j < 10000; j++) {\r\n                runtime.registerJavaMethod(new JavaCallback() {\r\n\r\n                    @Override\r\n                    public Object invoke(final V8Object receiver, final V8Array parameters) {\r\n                        // TODO Auto-generated method stub\r\n                        return null;\r\n                    }\r\n                }, \"foo\" + j);\r\n            }\r\n            runtime.release();\r\n        }\r\n    }\r\n```\r\n\r\nThis is a duplicate of #19. I'll close that bug since this one contains more information now."}}