Search code examples
androidasynchronousmemoryrealm

Android application is consuming high storage memory


enter image description hereIt's about a Memory consumption issue that I am facing with my application.

The application basically uploads medias to a server.

i am using external libraries like Realm, retrofit, Glide, sliding panel etc.

Is the library has anything to do with this issue ?

How to track the code that causes this issue?

My /data/data folder takes only 833k size enter image description here Thank you


Solution

  • The realm was the cause of the trouble. Realm.close() solved my problem.

     realm.executeTransaction(new Realm.Transaction() {
                    @Override
                    public void execute(Realm {
                        if (!realm.isClosed()){
                            Realm realm1 = Realm.getDefaultInstance();
                            realm1.close();
                        }
                    }
    
                });