3

[INTRO] I have developed an android app about a year ago and it is having acceptable success in the play store. I am always improving it to offer optimal performance.

[PROBLEM] I have recently noticed that the application is using three processes even when in background. Attached screenshot at the end of the post for more details.

To start with the app has 3 processes running:
1- The main app process.
2- The google play store service (Since it offers in app purchase).
3- The google play services since the free version runs some ads.

Questions:
1- Doesnt the ram usage seem high (knowing that i probably dont have memory leaks since i have worked on this topic previously)
2- Why would the google play service keep running in the background even though i am destroying all ads objects just when needed.
3- Why is the google play store service running continuously and in the background.

Please advise on the above and inform me of how to fix or spot potential issues, and how to reduce memory usage while in background (I.E. facebook app in background does not use ram as much as my much simpler app does).

Hint about the app:
1- Material design with three tabs (at most 2 initialized at once).
2- Uses a notification listener service.
3- Uses google admob
4- Has in-app purchases.
5- Uses facebook fresco for images.

Thanks in advance.

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Elio Khattar
  • 320
  • 1
  • 3
  • 16

1 Answers1

0

Long story short:
The issue seems to happen whenever the NotificationListenerService is run within the same process of the application. This SEEMS to be related some incompatibilities with google analytics SDK.

To solve it, run the NotificationListenerService is a different process. (This also requires some changes on the Broadcast messages if they are used).

This conclusion was done thanks to the below answer on a different thread. please check it since it is complete and straight forward:

https://stackoverflow.com/a/49033324/6181029

Dharman
  • 30,962
  • 25
  • 85
  • 135
Elio Khattar
  • 320
  • 1
  • 3
  • 16