I found the main reason why memory consumption is high.Rather than from the MAT
,after removing various views from layout and various statements,I found that I am using font from the asset
folder which was the main culprit.
headingText.setTypeface(Typeface.createFromAsset(context.getAssets(), DataHolder.FONT_PATH));
So by doing this maybe Context
is being referenced or TypeFace
is being referenced and was never garbage collected
.But removing this line of code fixed all the memory leak issue on my app.
Further this issue can be solved using the technique described here Typeface memory leak