All this means that the garbage collector does its job and frees up memory.
If you see this often (or sequentially), then you are probably highlighting too many objects. A common reason is the allocation of many (or several large) objects in a loop as follows:
for (int i = 0; i < 100; i++) { Bitmap bmp = Bitmap.create(100, 100, Bitmap.Config.ARGB_4444); }
Each time we fall into this cycle, we highlight one hundred new Bitmap objects.
The best way to prevent GC sweeps is to not select objects. Of course, you need to allocate objects in Java, so you need to make sure that you are not assigning unnecessarily.
Here is one of many YouTube videos that Google has released with tips on preventing GC events and managing memory properly.
Tanis.7x
source share