0

I implemented push notifications in my project according to latest tutorial from google.

My app has 2 background services running.

When I look into RAM memory, which my app occupies, I see (for instance):
- total memory used 117 Mb
- memory used by app 13 Mb
- Google play services (com.google.android.gms) - 104 Mb (!).
And it written below, that service MeasurementBrokerService is in usage.

What am I doing wrong?
Why push notifications need so much memory? What is this MeasurementBrokerService, is it possible to disable that?

Goltsev Eugene
  • 3,325
  • 6
  • 25
  • 48

2 Answers2

1

You can try this,

on the start of your AndroidManifest add this line: xmlns:tools="http://schemas.android.com/tools"

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="cl.datacomputer.alejandrob.example"
   xmlns:tools="http://schemas.android.com/tools">

and inside of the Application add this service tag:

<application
    android:name="android.support.multidex.MultiDexApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:screenOrientation="portrait">

    <service android:name="com.google.android.gms.measurement.AppMeasurementService"
        tools:replace="android:enabled"
        android:enabled="false"
        android:exported="false"/>

It's not a good solution, I know, but you can disable the service that causes the memory leak.

Sorry if my English is bad.

Regards.

Alejandro Burgos.

0

Dublicate question here: "Service MeasurementBrokerService is in use" is showing in my application process

Here is my answer to both.

I got rid of this service and couple of others by removing

NotificationCompat.Builder
...
startForeground(mNotificationId, notificationBuilder.build());

from my backround service.

For some reason. Alejandros solution did not work for me.

kivmii
  • 178
  • 2
  • 10