{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-core/issues/400","repository_url":"https://api.github.com/repos/FasterXML/jackson-core","labels_url":"https://api.github.com/repos/FasterXML/jackson-core/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-core/issues/400/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-core/issues/400/events","html_url":"https://github.com/FasterXML/jackson-core/issues/400","id":257653629,"number":400,"title":"BufferRecyclers are not released on shutdown of the application","user":{"login":"jborgers","id":24591067,"avatar_url":"https://avatars1.githubusercontent.com/u/24591067?v=4","gravatar_id":"","url":"https://api.github.com/users/jborgers","html_url":"https://github.com/jborgers","followers_url":"https://api.github.com/users/jborgers/followers","following_url":"https://api.github.com/users/jborgers/following{/other_user}","gists_url":"https://api.github.com/users/jborgers/gists{/gist_id}","starred_url":"https://api.github.com/users/jborgers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jborgers/subscriptions","organizations_url":"https://api.github.com/users/jborgers/orgs","repos_url":"https://api.github.com/users/jborgers/repos","events_url":"https://api.github.com/users/jborgers/events{/privacy}","received_events_url":"https://api.github.com/users/jborgers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-09-14T09:30:44Z","updated_at":"2017-10-09T12:05:44Z","closed_at":null,"author_association":"NONE","body":"We see a class loader memory leak by using Jackson: on redeployment of our application in WebSphere we see an increase of heap usage of a couple of hundred MB's en after several redeployments heap usage becomes close to the heap size and garbage collection takes a lot of CPU. Note that most extra heap is taken by the BufferRecyclers retaining char[][]'s.\r\n\r\nSoftReferences may help to prevent out of memory errors, it doesn't help for gc overhead (including long compaction pauses.)\r\nIn addition, the BufferRecycler classes of previous deployed versions of the app are still in the ThreadLocals of all threads of the threadpool and prevent the classloader with all its classes to be unloaded.\r\nSee here: https://stackoverflow.com/questions/17968803/threadlocal-memory-leak for more on classloader leaks.\r\n\r\nWe would like Jackson to release/remove the BufferRecyclers from the ThreadLocals on shutdown, by calling a shutdown method on e.g. JsonFactory.\r\nSee also: http://java.jiderhamn.se/2012/02/26/classloader-leaks-v-common-mistakes-and-known-offenders/"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-core/issues/comments/335138341","html_url":"https://github.com/FasterXML/jackson-core/issues/400#issuecomment-335138341","issue_url":"https://api.github.com/repos/FasterXML/jackson-core/issues/400","id":335138341,"user":{"login":"jborgers","id":24591067,"avatar_url":"https://avatars1.githubusercontent.com/u/24591067?v=4","gravatar_id":"","url":"https://api.github.com/users/jborgers","html_url":"https://github.com/jborgers","followers_url":"https://api.github.com/users/jborgers/followers","following_url":"https://api.github.com/users/jborgers/following{/other_user}","gists_url":"https://api.github.com/users/jborgers/gists{/gist_id}","starred_url":"https://api.github.com/users/jborgers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jborgers/subscriptions","organizations_url":"https://api.github.com/users/jborgers/orgs","repos_url":"https://api.github.com/users/jborgers/repos","events_url":"https://api.github.com/users/jborgers/events{/privacy}","received_events_url":"https://api.github.com/users/jborgers/received_events","type":"User","site_admin":false},"created_at":"2017-10-09T12:05:44Z","updated_at":"2017-10-09T12:05:44Z","author_association":"NONE","body":"@cowtowncoder We have good results from the load test on WebSphere/J9-JVM! The BufferRecyclers are released after the shutdown method is called on undeploy and the classloader is also released.\r\nI put the change in JsonFactory in my fork: https://github.com/jborgers/jackson-core.\r\nHow can we go forward?"}}
{"actor":{"display_login":"jborgers"}}