What is the global message pool in Android? Where is he in memory?

When I looked at the functionality of Handler.obtainMessage () , I read that it retrieves the message from the global message pool instead of creating a new message instance. Where is this shared message pool located?
Is this a collection of all the message objects that were created earlier?

+4
source share
3 answers

It just means that dalvik stores messages in a pool of recycled objects. They are created and saved from the static pool thread:

private static Message sPool;

, , recyle.

.

: heap.

+3

Message. static. .

recycle().

+2

:

Message obtain() :

http://androidxref.com/4.4.2_r1/xref/frameworks/base/core/java/android/os/Message.java#106

:

private static Message sPool;

( ), .

public void recycle(), .

+1

Source: https://habr.com/ru/post/1526558/


All Articles