What are the "distribution pools for temporary objects"?

im reading an article on preparing for android: performance recommendations

Creating an object is never free. Collective garbage collection from thread allocation pools for temporary objects may allocate less, but allocating memory is always more expensive than allocating memory.

What are the thread allocation pools for temporary objects?

I did not find any documents about this.

+4
source share
2 answers

Read it as: generation-oriented, garbage collector, pools for temporary objects.

In a stream garbage collection, each object tracks only objects associated with the stream that created them. At the time of garbage collection for a particular stream, it is determined which objects associated only with this stream remain accessible from the limited root set associated with the stream. Any stream-only objects that are not defined to achieve accessibility are garbage collection.

0
source

What they say, and they are right, that the creation of an object (and subsequent assembly) can be a major factor in time.

If you look at this example , you will see that at some point memory management dominated in time and was fixed by storing the used objects of each class in a free-list, so they could be reused efficiently.

However, also note that in this case, memory management was not the biggest problem. This became the biggest problem after removing even bigger problems.

For example, suppose you have a team of people who want to lose weight compared to another team. Suppose a team has 1) a person at 400 pounds, (which corresponds to some other problem)
2) 200 pound person (corresponding to the problem of memory management) and
3) a person at 100 pounds (corresponding to some other problem).
If the team as a whole wants to lose the most weight, where should it focus first?

Obviously, they need to work on all three, but if they miss the big guy, they are not going to go far.

So, the most aggressive procedure first finds out what is the biggest problem (without guessing), and fix it. Then the next largest, etc.

The big secret is not to guess. Everyone knows this, but what do they do? - they still guess. Guess, by definition, are often mistaken, lacking the biggest problems. Let the program tell you what the biggest problem is. (I use random suspension , as in this example.)

0
source

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


All Articles