I have a requirement for my app to update the list in every few seconds. I am using REST call to get the data from server, process it (some filters and mapping) and assign to RadlistView. I have noticed that after 5-10 minutes app becomes very unresponsive and list actually freeze to scroll.
When I check the memory, it looks kike app used memory is increasing on every REST call.
Below is the code that I have used to check the memory
var mi = new android.app.ActivityManager.MemoryInfo();
var activityManager = application.android.context.getSystemService(android.content.Context.ACTIVITY_SERVICE);
let usedMemory = mi.totalMem - mi.availMem;
// console.log("availMem in bytes: " + mi.availMem);
// console.log("availMem in bytes: " + mi.availMem); console.log("Percentage usage: " + (usedMemory / mi.totalMem)*100); // console.log("Available memory (megabytes): " + mi.availMem); console.log("Used memory (megabytes): " + (usedMemory/1000000));
As I am using page-router-outlet, ngDestory is not getting called every time when user moves away from this page. But I have tried make my list source null/new array on page unload. I have also tried to call GC on page unload but no success.
Has anyone any suggestion to improve this?