Mohan K
Mohan K

Reputation: 484

Get Below logs in log cat

I'm getting this log in my logcat

I/zygote: Background concurrent copying GC freed 148531(5MB) AllocSpace objects, 18(936KB) LOS objects, 32% free, 12MB/18MB, paused 3.758ms total 217.199ms

is this something that needs to be addressed or it is can be ignored

Upvotes: 0

Views: 105

Answers (2)

Kaushik Burkule
Kaushik Burkule

Reputation: 884

This is not an error, it's just an Android log message notifying you about when garbage collection takes place. Everything's normal. The log messages don't harm your app. It's only a problem if you go out of memory, or you see performance hiccups due to garbage collection.

If you are seeing this frequently (or consistently), then you are likely allocating too many objects. A common cause is allocating many (or a few large) objects within a loop

Every time we hit this loop, we allocate one hundred new Bitmap objects.

The best way to prevent GC sweeps is to not allocate objects. Of course you have to allocate objects in Java, so you need to ensure that you are not allocating unnecessarily.

Finally, you can always filter or ignore the logs. :D

Upvotes: 2

Samy Ke
Samy Ke

Reputation: 1

This page may help you with further research: https://blog.gceasy.io/2017/05/09/understanding-android-gc-logs/

Upvotes: -1

Related Questions