{"action":"created","issue":{"url":"https://api.github.com/repos/Jasig/cas/issues/493","labels_url":"https://api.github.com/repos/Jasig/cas/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/Jasig/cas/issues/493/comments","events_url":"https://api.github.com/repos/Jasig/cas/issues/493/events","html_url":"https://github.com/Jasig/cas/issues/493","id":37854794,"number":493,"title":"Memory Leak in TicketGrantingTicketImpl","user":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Jasig/cas/labels/3.5.2","name":"3.5.2","color":"bfd4f2"},{"url":"https://api.github.com/repos/Jasig/cas/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/Jasig/cas/labels/Minor","name":"Minor","color":"fbca04"},{"url":"https://api.github.com/repos/Jasig/cas/labels/Ticket","name":"Ticket","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Jasig/cas/milestones/11","html_url":"https://github.com/Jasig/cas/milestones/4.2.0","labels_url":"https://api.github.com/repos/Jasig/cas/milestones/11/labels","id":1202350,"number":11,"title":"4.2.0","description":"CAS version 4.2.0 minor release","creator":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":52,"state":"open","created_at":"2015-07-10T11:23:44Z","updated_at":"2015-09-26T05:59:25Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2014-07-15T06:28:47Z","updated_at":"2015-09-29T09:25:06Z","closed_at":null,"body":"TicketGrantingTicketImpl contains a hashmap of services (service by id). This references are used to logout from all services which have been used in case the TGT expire(s). Only in case of the expire these pairs (id, service) are released.\r\n\r\nProblem is that the id used to store a service in the hashmap is the service ticket id. It is generated in CentralAuthenticationServiceImpl.grantServiceTicket\r\n\r\n``````````\r\n...\nfinal ServiceTicket serviceTicket = ticketGrantingTicket\n.grantServiceTicket(serviceTicketUniqueTicketIdGenerator\n.getNewTicketId(ServiceTicket.PREFIX), service,\nthis.serviceTicketExpirationPolicy, credentials != null);\nthis.serviceTicketRegistry.addTicket(serviceTicket);\r\n``````````\r\n\r\nThat means the TGT services hashmap contains one entry per Service Ticket which was created during the live time of the TGT. With long RememberMe times this causes TGT to consume substantial memory. In our case with web page = service we end up with approx. 1MByte per TGT after 10-20days.\r\n\r\nI propose to introduce an explicit logout url per service and use it instead of the ST id to store the service. This would allow to have one logout per service e.g. webapp in our case.\r\n\r\nReported by: Wilko Kempa, id: Cotopax\r\n\r\nCreated: Mon, 27 Jan 2014 12:54:21 -0700\r\n\r\nUpdated: Mon, 27 Jan 2014 12:54:21 -0700\r\n\r\nJIRA: https://issues.jasig.org/browse/CAS-1420"},"comment":{"url":"https://api.github.com/repos/Jasig/cas/issues/comments/144004514","html_url":"https://github.com/Jasig/cas/issues/493#issuecomment-144004514","issue_url":"https://api.github.com/repos/Jasig/cas/issues/493","id":144004514,"user":{"login":"robertoschwald","id":1519879,"avatar_url":"https://avatars.githubusercontent.com/u/1519879?v=3","gravatar_id":"","url":"https://api.github.com/users/robertoschwald","html_url":"https://github.com/robertoschwald","followers_url":"https://api.github.com/users/robertoschwald/followers","following_url":"https://api.github.com/users/robertoschwald/following{/other_user}","gists_url":"https://api.github.com/users/robertoschwald/gists{/gist_id}","starred_url":"https://api.github.com/users/robertoschwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertoschwald/subscriptions","organizations_url":"https://api.github.com/users/robertoschwald/orgs","repos_url":"https://api.github.com/users/robertoschwald/repos","events_url":"https://api.github.com/users/robertoschwald/events{/privacy}","received_events_url":"https://api.github.com/users/robertoschwald/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T09:25:06Z","updated_at":"2015-09-29T09:25:06Z","body":"Thanks Jerome, this was one feature I waited for a long time. We are using long term tickets with JPA Ticket stores and needed to grow the MAX_PACKET_SIZE in MySQL for such very large TGT blob entries in the past. One thing you can't avoid with a fix currently are registered wildcard service urls. We avoid wildcard patterns strictly for all CAS clients since a while, as they can blow your CAS service availability. \r\n\r\n+1\r\n"}}