{"action":"created","issue":{"url":"https://api.github.com/repos/kiegroup/kie-wb-common/issues/1685","repository_url":"https://api.github.com/repos/kiegroup/kie-wb-common","labels_url":"https://api.github.com/repos/kiegroup/kie-wb-common/issues/1685/labels{/name}","comments_url":"https://api.github.com/repos/kiegroup/kie-wb-common/issues/1685/comments","events_url":"https://api.github.com/repos/kiegroup/kie-wb-common/issues/1685/events","html_url":"https://github.com/kiegroup/kie-wb-common/pull/1685","id":317447989,"number":1685,"title":"JBPM-5462: Stunner - Memory leaks","user":{"login":"romartin","id":4602417,"avatar_url":"https://avatars1.githubusercontent.com/u/4602417?v=4","gravatar_id":"","url":"https://api.github.com/users/romartin","html_url":"https://github.com/romartin","followers_url":"https://api.github.com/users/romartin/followers","following_url":"https://api.github.com/users/romartin/following{/other_user}","gists_url":"https://api.github.com/users/romartin/gists{/gist_id}","starred_url":"https://api.github.com/users/romartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romartin/subscriptions","organizations_url":"https://api.github.com/users/romartin/orgs","repos_url":"https://api.github.com/users/romartin/repos","events_url":"https://api.github.com/users/romartin/events{/privacy}","received_events_url":"https://api.github.com/users/romartin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-25T01:21:03Z","updated_at":"2018-04-30T01:03:01Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/kiegroup/kie-wb-common/pulls/1685","html_url":"https://github.com/kiegroup/kie-wb-common/pull/1685","diff_url":"https://github.com/kiegroup/kie-wb-common/pull/1685.diff","patch_url":"https://github.com/kiegroup/kie-wb-common/pull/1685.patch"},"body":"Hey @hasys @manstis @tiagodolphine \r\n\r\nHere is the PR that fixes the most important memory leaks. These are the related tickets:\r\n- https://issues.jboss.org/browse/JBPM-5462\r\n- https://issues.jboss.org/browse/JBPM-6330\r\n\r\nHere are the most important changes:\r\n\r\n**Fixed leaks on lienzo side**\r\nThe two most relevant were on the LIenzoHandlerManager and on the Pictures - some handlers and DOM elements were added but never removed again, this was causing the toolbox, and any other component that uses lienzo pictures (images), to be leaking on each rendering operation.\r\n\r\n**Fixed leaks in Stunner \"factories\"**\r\nIn general removed most of the  Stunner \"factory\" types and implementations, like session factories, presenters factories, canvas factrories, control facorires, etc. \r\nThis way refactored the different beans, which were produced by those factories, into injectable CDI beans, so the scope for that beans, and its resource consumption, its being managed by the dependent instance scope as well\r\n\r\n**Fixed leaks in Stunner client components - sessions and controls** \r\nRenamed `ClientReadOnlySession` and `ClientFullSession` by `ViewerSession` and `EditorSession`. \r\nAlso removed all factories and created \"managed\" implementations, like the `ManagedSession`, which obtains the right CDI instances for each of the session components at runtime.\r\n\r\n**Fixed leaks in other Stunner widgets, presenters, screens and editors**\r\nThis way the editors and screens are now creating and destroying all the instances given their life-cycle methods (onOpen, onClose, etc)\r\n\r\n- Refactored the `ClientSessionCommands` and the use in the editors..\r\n\r\n- Changed also some scope for beans and lots of other small changes in several components to ensure they're destroying their states, and the states for the dependent instances...\r\n\r\n**NOTICE** there is still some missing work to do on the testing side - there are a few  `@Ignored` tests, others are still missing to be refactored, missing tests for the lienzo side too. and in general are missing tests for some of the new classes in Stunner, will keep working on this tomorrow, but at least this way you can start the review, as I expect it can take a few days.\r\n\r\n**PS #1**: I don't say all the memory leaks are fixed, but it works fine after opening,saving, close, creating and reopening several diagrams... so please take this into account  it doesn't make sense to start profiling the application and identify the missing leaks, the goals for this task are making Stunner good enough for a product release. \r\n\r\n**PS #2**: Next step is to improve the performance on some computations, as you'll see that initially it takes like 1-2sec in some operations to complete. Will try to work on this during next week.\r\n\r\n**PS #3**: I'm sorry for the size of the PR! But due to removing factories and client session implementations in general the number of changed files was grown so fast... \r\n\r\n**Related PRs**:\r\n- https://github.com/kiegroup/lienzo-core/pull/21\r\n- https://github.com/kiegroup/lienzo-tests/pull/18\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/kiegroup/kie-wb-common/issues/comments/385296708","html_url":"https://github.com/kiegroup/kie-wb-common/pull/1685#issuecomment-385296708","issue_url":"https://api.github.com/repos/kiegroup/kie-wb-common/issues/1685","id":385296708,"user":{"login":"romartin","id":4602417,"avatar_url":"https://avatars1.githubusercontent.com/u/4602417?v=4","gravatar_id":"","url":"https://api.github.com/users/romartin","html_url":"https://github.com/romartin","followers_url":"https://api.github.com/users/romartin/followers","following_url":"https://api.github.com/users/romartin/following{/other_user}","gists_url":"https://api.github.com/users/romartin/gists{/gist_id}","starred_url":"https://api.github.com/users/romartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romartin/subscriptions","organizations_url":"https://api.github.com/users/romartin/orgs","repos_url":"https://api.github.com/users/romartin/repos","events_url":"https://api.github.com/users/romartin/events{/privacy}","received_events_url":"https://api.github.com/users/romartin/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T01:03:01Z","updated_at":"2018-04-30T01:03:01Z","author_association":"CONTRIBUTOR","body":"Jenkins please retest this"}}
{"actor":{"display_login":"romartin"}}