{"action":"closed","issue":{"url":"https://api.github.com/repos/Pi4J/pi4j/issues/235","repository_url":"https://api.github.com/repos/Pi4J/pi4j","labels_url":"https://api.github.com/repos/Pi4J/pi4j/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/Pi4J/pi4j/issues/235/comments","events_url":"https://api.github.com/repos/Pi4J/pi4j/issues/235/events","html_url":"https://github.com/Pi4J/pi4j/issues/235","id":150528588,"number":235,"title":"Unreused/unreclaimed parked threads","user":{"login":"alexcatit","id":18626945,"avatar_url":"https://avatars.githubusercontent.com/u/18626945?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcatit","html_url":"https://github.com/alexcatit","followers_url":"https://api.github.com/users/alexcatit/followers","following_url":"https://api.github.com/users/alexcatit/following{/other_user}","gists_url":"https://api.github.com/users/alexcatit/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcatit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcatit/subscriptions","organizations_url":"https://api.github.com/users/alexcatit/orgs","repos_url":"https://api.github.com/users/alexcatit/repos","events_url":"https://api.github.com/users/alexcatit/events{/privacy}","received_events_url":"https://api.github.com/users/alexcatit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-23T07:39:17Z","updated_at":"2016-04-23T14:18:08Z","closed_at":"2016-04-23T14:18:08Z","body":"I've noticed that in my application there are a lot of \"parked\" threads.\r\nI've changed name in my thread factory to distinguish between my threads and threads created by libraries.\r\n\r\n[http://postimg.org/image/7r0ar3rwn/](url)\r\n\r\nLooking at the pi4j code, I noticed that threads created by GpioFactory.getExecutorServiceFactory().newSingleThreadExecutorService() (called by GpioEventDebounceTaskImpl) are put into an arraylist for shutdown later. This may be a good thing, but for a long running application, these parked thread consume a lot of memory in the stack.\r\n"}}