What happens to memory when putExtra () is called?

In my Android app, I have a large ArrayList object (over 100) and I am passing this ArrayList from activity to activity via intents using putExtra (key, value) function. What exactly happens to the memory when I do such a thing, does the ArrayList copy so that it now takes up twice the memory it needs? or the jst gets the link so the space stays the same?

+3


source to share


1 answer


When you pass yours ArrayList

, you serialize / strip it. This is called marshalling . On the other hand, you read these premises and do unmarshalling. What it does is basically convert yours ArrayList

to the stream that you read on the other end and create the COPY of the original.



+6


source







All Articles