{"action":"closed","issue":{"url":"https://api.github.com/repos/flatpak/flatpak/issues/1700","repository_url":"https://api.github.com/repos/flatpak/flatpak","labels_url":"https://api.github.com/repos/flatpak/flatpak/issues/1700/labels{/name}","comments_url":"https://api.github.com/repos/flatpak/flatpak/issues/1700/comments","events_url":"https://api.github.com/repos/flatpak/flatpak/issues/1700/events","html_url":"https://github.com/flatpak/flatpak/issues/1700","id":325451003,"node_id":"MDU6SXNzdWUzMjU0NTEwMDM=","number":1700,"title":"flatpak-system-helper grows in memory when chain installing apps (potentially leaking)","user":{"login":"ahayzen","id":3669750,"node_id":"MDQ6VXNlcjM2Njk3NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/3669750?v=4","gravatar_id":"","url":"https://api.github.com/users/ahayzen","html_url":"https://github.com/ahayzen","followers_url":"https://api.github.com/users/ahayzen/followers","following_url":"https://api.github.com/users/ahayzen/following{/other_user}","gists_url":"https://api.github.com/users/ahayzen/gists{/gist_id}","starred_url":"https://api.github.com/users/ahayzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahayzen/subscriptions","organizations_url":"https://api.github.com/users/ahayzen/orgs","repos_url":"https://api.github.com/users/ahayzen/repos","events_url":"https://api.github.com/users/ahayzen/events{/privacy}","received_events_url":"https://api.github.com/users/ahayzen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-22T20:28:45Z","updated_at":"2018-09-28T11:47:17Z","closed_at":"2018-09-28T11:47:17Z","author_association":"NONE","body":"## Linux distribution and version\r\n\r\nUbuntu 18.04\r\n\r\n## Flatpak version\r\n\r\nFlatpak 0.11.7\r\nOSTree 2018.4\r\n\r\n## Description of the problem\r\n\r\nWhen chain installing multiple apps I happened to be watching the highest memory of processes (both \"memory\" and resident memory in gnome-system-monitor). I noticed that the process `flatpak-system-helper` increased in memory with each app that it installed (this potentially could affect updates as well).\r\n\r\nIt seems like with each application it doesn't clean up and the memory increases in steps, eg starting low ~50-100, then 100-200, 200-300 etc with each app.\r\n\r\n## Steps to reproduce\r\n\r\n1) In a terminal run `$ flatpak install flathub org.kde.kdenlive org.kde.krita org.kde.okular` eg pick at least 3 apps that you don't have installed (also I was missing at least one runtime)\r\n2) Watch in your system monitor the memory of flatpak-system-helper increase as each app in turn is installed.\r\n\r\n## What I expected to happen\r\n\r\nAt step 2 for the memory to remain consistent and not increase as more apps are installed.\r\n\r\n## Valgrind\r\n\r\nI ran the steps under `valgrind` by starting `# valgrind /usr/lib/flatpak/flatpak-system-helper --replace --no-idle-exit` as root before step 1.\r\n\r\nflatpak install - https://pastebin.ubuntu.com/p/75G4Nqpnbk/\r\nvalgrind  flatpak-system-helper - https://pastebin.ubuntu.com/p/HWFqG2XPwc/\r\n\r\nThe valgrind summary at exit is\r\n```\r\n==20103== HEAP SUMMARY:\r\n==20103==     in use at exit: 6,519,331 bytes in 43,738 blocks\r\n==20103==   total heap usage: 21,881,673 allocs, 21,837,935 frees, 1,045,276,412 bytes allocated\r\n==20103== \r\n==20103== LEAK SUMMARY:\r\n==20103==    definitely lost: 2,047,160 bytes in 6,941 blocks\r\n==20103==    indirectly lost: 621,269 bytes in 9,571 blocks\r\n==20103==      possibly lost: 2,960 bytes in 26 blocks\r\n==20103==    still reachable: 3,823,854 bytes in 27,010 blocks\r\n==20103==                       of which reachable via heuristic:\r\n==20103==                         length64           : 3,064 bytes in 64 blocks\r\n==20103==                         newarray           : 1,952 bytes in 42 blocks\r\n==20103==         suppressed: 0 bytes in 0 blocks\r\n```\r\n\r\nWhich doesn't suggest much is definitely lost (~2MiB) however I wonder if the memory is not being \"lost\" but just incorrectly held between the steps of installing each app ?"}}
{"actor":{"display_login":"matthiasclasen"}}