{"action":"created","issue":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/880","labels_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/880/labels{/name}","comments_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/880/comments","events_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/880/events","html_url":"https://github.com/ControlSystemStudio/cs-studio/issues/880","id":54325768,"number":880,"title":"Memory Leak in BOY","user":{"login":"jbobnar","id":5602519,"avatar_url":"https://avatars.githubusercontent.com/u/5602519?v=3","gravatar_id":"","url":"https://api.github.com/users/jbobnar","html_url":"https://github.com/jbobnar","followers_url":"https://api.github.com/users/jbobnar/followers","following_url":"https://api.github.com/users/jbobnar/following{/other_user}","gists_url":"https://api.github.com/users/jbobnar/gists{/gist_id}","starred_url":"https://api.github.com/users/jbobnar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbobnar/subscriptions","organizations_url":"https://api.github.com/users/jbobnar/orgs","repos_url":"https://api.github.com/users/jbobnar/repos","events_url":"https://api.github.com/users/jbobnar/events{/privacy}","received_events_url":"https://api.github.com/users/jbobnar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-14T14:09:31Z","updated_at":"2015-01-15T15:09:39Z","closed_at":null,"body":"There is a serious memory leak in BOY. Any OPI that is opened is retained in memory forever. An easy way to see this is to open and close a high-memory-consuming opi (...opibuilder.imagelib/demo/PID_Water_Cooling.opi is a good example). If you repeat the open/close many times, you can see the memory consumption going up. Using a profiler, one can see that the OPIRunner and other opi elements are being retained in memory.\r\n\r\nThere are 2 problems:\r\n1. In the whole chain of classes and delegates (like OPIRunner and OPIRuntimeDelegate) some of the things are never disposed of. \r\n2. Every contribution to the toolbar is retained in the ToolBarManagerRenderer until shutdown.\r\n\r\nThe problem 1. is fairly straightforward to fix and already fixes 99% of the leak. One just need to make sure that the dispose calls are properly forwarded.\r\nThe problem 2. is more difficult. Every time when an OPI is opened the OPIRunnerToolbarContributor regenerates the toolbar items, the items are added to the ToolBarManagerRenderer (modelToContribution) and are never removed. I think the definition of the toolbar items should be done in the plugin.xml (through extensions), similar to how it is done in the scantree case. "},"comment":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/comments/70099150","html_url":"https://github.com/ControlSystemStudio/cs-studio/issues/880#issuecomment-70099150","issue_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/880","id":70099150,"user":{"login":"jbobnar","id":5602519,"avatar_url":"https://avatars.githubusercontent.com/u/5602519?v=3","gravatar_id":"","url":"https://api.github.com/users/jbobnar","html_url":"https://github.com/jbobnar","followers_url":"https://api.github.com/users/jbobnar/followers","following_url":"https://api.github.com/users/jbobnar/following{/other_user}","gists_url":"https://api.github.com/users/jbobnar/gists{/gist_id}","starred_url":"https://api.github.com/users/jbobnar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbobnar/subscriptions","organizations_url":"https://api.github.com/users/jbobnar/orgs","repos_url":"https://api.github.com/users/jbobnar/repos","events_url":"https://api.github.com/users/jbobnar/events{/privacy}","received_events_url":"https://api.github.com/users/jbobnar/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T15:09:39Z","updated_at":"2015-01-15T15:09:39Z","body":"There is no difference with boy_runtime_view branch. Drilling deeper it appears that the root cause is in eclipse. The bug is similar to this one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=206584\r\n\r\nAfter opening a new WorkbenchWindow the instance is referenced from all over the place and never released. No solution found yet.\r\n\r\n"}}