2016-09-29 16 views
0

私のプロジェクトでは、latest tutorial from googleに従ってプッシュ通知を実装しました。Android GCM MeasurementBrokerServiceのメモリが多すぎます

私のアプリは2つのバックグラウンドサービスを実行しています。

私は私のアプリが占有RAMメモリ、に見たとき、私は(例えば)を参照してください。
- アプリ13 Mbの
が使用するメモリ - - 合計メモリは117 Mbの
を使用Googleは(サービスを再生com.google.android.gms) - 104 Mb(!)
これは、MeasurementBrokerServiceサービスが使用中であることを示しています。

私は間違っていますか?
プッシュ通知に必要なメモリが大量に必要な理由 このMeasurementBrokerServiceとは何ですか、無効にすることはできますか?あなたはこれを試みることができる

答えて

1

、あなたのAndroidManifestの開始に

この行を追加します。のxmlns:ツール= "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"> 

との内部を

<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"/> 

それは私が知っている良い解決策ではないのですが、あなたはメモリリークが発生するサービスを無効にすることができます。アプリケーションは、このサービスタグを追加します。

私の英語は悪いです。

よろしくお願いいたします。

アレハンドロブルゴス。ここ

+0

偉大なハックの解決策は、魅力のように動作します。ありがとう!! –

+0

それは何もなかった:) –

0

Dublicate質問:"Service MeasurementBrokerService is in use" is showing in my application process

はここで両方の私の答えです。

私は私のbackroundのサービスから

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

を除去することにより、本サービスと他人のカップルを処分しました。

何らかの理由により。 Alejandrosの解決策は私には役に立たなかった。

関連する問題