{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/JsonPath/issues/94","labels_url":"https://api.github.com/repos/jayway/JsonPath/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/jayway/JsonPath/issues/94/comments","events_url":"https://api.github.com/repos/jayway/JsonPath/issues/94/events","html_url":"https://github.com/jayway/JsonPath/issues/94","id":82711081,"number":94,"title":"memory leak","user":{"login":"tranwarpxl","id":12668874,"avatar_url":"https://avatars.githubusercontent.com/u/12668874?v=3","gravatar_id":"","url":"https://api.github.com/users/tranwarpxl","html_url":"https://github.com/tranwarpxl","followers_url":"https://api.github.com/users/tranwarpxl/followers","following_url":"https://api.github.com/users/tranwarpxl/following{/other_user}","gists_url":"https://api.github.com/users/tranwarpxl/gists{/gist_id}","starred_url":"https://api.github.com/users/tranwarpxl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tranwarpxl/subscriptions","organizations_url":"https://api.github.com/users/tranwarpxl/orgs","repos_url":"https://api.github.com/users/tranwarpxl/repos","events_url":"https://api.github.com/users/tranwarpxl/events{/privacy}","received_events_url":"https://api.github.com/users/tranwarpxl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-30T05:36:19Z","updated_at":"2015-08-10T08:25:36Z","closed_at":null,"body":"One of our QA servers ran out of memory, looks like there is a memory leak in Cache.java.\r\nA simple single-threaded program to reproduce the issue is below.\r\nI think it is better to allow the user to disable the cache, and let the user create (and cache) CompiledPath instances.\r\n\r\n    public static void main(String[] arg) {\r\n        Cache cache = new Cache(200);\r\n        Path dummy = new CompiledPath(null, false);\r\n        for (int i = 0; i < 10000; ++i) {\r\n           String key = String.valueOf(i);\r\n           cache.get(key);\r\n           cache.put(key, dummy);\r\n        }\r\n        System.out.println(\"cache size: \" + cache.size());\r\n    }\r\n"},"comment":{"url":"https://api.github.com/repos/jayway/JsonPath/issues/comments/129361424","html_url":"https://github.com/jayway/JsonPath/issues/94#issuecomment-129361424","issue_url":"https://api.github.com/repos/jayway/JsonPath/issues/94","id":129361424,"user":{"login":"jochenberger","id":370733,"avatar_url":"https://avatars.githubusercontent.com/u/370733?v=3","gravatar_id":"","url":"https://api.github.com/users/jochenberger","html_url":"https://github.com/jochenberger","followers_url":"https://api.github.com/users/jochenberger/followers","following_url":"https://api.github.com/users/jochenberger/following{/other_user}","gists_url":"https://api.github.com/users/jochenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/jochenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jochenberger/subscriptions","organizations_url":"https://api.github.com/users/jochenberger/orgs","repos_url":"https://api.github.com/users/jochenberger/repos","events_url":"https://api.github.com/users/jochenberger/events{/privacy}","received_events_url":"https://api.github.com/users/jochenberger/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T08:25:36Z","updated_at":"2015-08-10T08:25:36Z","body":"We could switch to a `Map<String, SoftReference<Path>>` for the cache."}}