-
Bug
-
Resolution: Fixed
-
Low
-
None
-
No-Version
-
None
-
2
-
Severity 3 - Minor
-
Summary
The Companion app leaks memory if the process is started twice.
- There will still be two processes running for the Companion app even on 0.6.0.
- But there should be only one instance of the app, which can be see with there being only one Companion App icon on the task-bar.
Environment
- Only observed on Windows
- App installed with .msi file
Steps to Reproduce
- Install the Companion app with the .msi file using the following script
- For 32-bit OS:
msiexec /qn /i "Atlassian Companion.msi" reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" /v "electron.app.Atlassian Companion" /d "\"C:\Program Files\Atlassian Companion\Atlassian Companion.exe\"" /f
- For 32-bit OS:
-
- For 64-bit OS:
msiexec /qn /i "Atlassian Companion.msi" reg add "HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" /v "electron.app.Atlassian Companion" /d "\"C:\Program Files (x86)\Atlassian Companion\Atlassian Companion.exe\"" /f
- For 64-bit OS:
- Reboot the computer
Expected Results
The app is started normally and no duplicate processes or memory issues are observed.
Actual Results
Duplicate processes for the app are observed, as we can see here:
One of the processes will leak memory at a rate of around 20 bytes per second. We have some cases where the memory usage reached more than 1GB before the app crashed after running in this situation for a few hours.
Notes
The installation method that triggers this situation is a workaround for the following bugs:
- https://jira.atlassian.com/browse/CONFSERVER-57792
- https://jira.atlassian.com/browse/CONFSERVER-57541
After running this installation method and rebooting the computer, we end up having two entries on the registry that trigger the app startup, one under the key HKEY_CURRENT_USER and the other under HKEY_LOCAL_MACHINE.
Even though this is not triggered under normal circumstances, the idea of this bug is that one of the following situations must be avoided:
- The app should check if it is already running before starting a new process, or
- If the possibility of having two processes is expected, the secondary process should not leak memory
If the app has one of those protection mechanisms bundled, we exclude the possibility of compromising the end-user computer resources.
Workaround 1
Remove one of the registry entries (either from HKLM or HKCU tree), which can be done by an administrator. Only one of the following entries must exist in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
For a 64 bit OS, the registry tree looks like this:
HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run
Workaround 2
Uncheck the Launch at startup box on the app itself, which can be done by the end user. This will effectively remove the registry entry from HKEY_CURRENT_USER, but the app will still start automatically on reboot due to the entry under HKEY_LOCAL_MACHINE.
- is related to
-
CONFSERVER-57792 Companion app MSI doesn't start automatically
-
- Closed
-
-
CONFSERVER-57541 Companion App MSI should automatically startup on next login after install
- Closed