I have observed that some services allocate <1 Mb of memory. I have tried to do the simplest background service (it prints on log "ok" when it receives a wifi scan broadcast), and I can see that the service allocates around 20 Mb of memory?
1- Why?
2- How can I reduce the allocated memory for my service?
NOTE: I see differences between the 2 ways I tried to measure memory usage.
- Using the Android Studio tool "Android Monitor"and
- on the phone, under
settings\running processes
(not sure if it is the right translation to english)