How to create a lightweight background service in Android?
<p>I have observed that some services allocate <strong>&lt;1 Mb</strong> 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 <strong>20 Mb</strong> of memory? </p>

<p>1- Why? </p>

<p>2- How can I reduce the allocated memory for my service?</p>

<p><strong>NOTE</strong>: I see differences between the 2 ways I tried to measure memory usage.</p>

<ol>
<li>Using the Android Studio tool "Android Monitor"and </li>
<li>on the phone, under <code>settings\running processes</code> (not sure if it is the right translation to english)</li>
</ol>