I am new to android programming. The memory consumption of may android app increases significantly over time. When analyzed through MAT, it shows the objects being piled up whose GC root is Native Stack
. Those objects are being referenced as global ref in native code, but properly being released over time I have also put logs to make sure the count matches.
The documentation about native stack
is not much clear as it just states:
In or out parameters in native code, such as user defined JNI code or JVM internal code. This is often the case as many methods have native parts and the objects handled as method parameters become GC roots. For example, parameters used for file/network I/O methods or reflection.
I am not quite sure what it says, where is the problem and how can I fix it. Any hints are much appreciated. Thanks in advance.