I have tried to clear all histories by using $ionicViewService.clearHistory() function. However, it seems that the histories are still remaining in the memory.
The console log for $rootScope.$viewHistory.histories indicated that they are quite similar between after and before running clearHistory(). The only different is the $rootScope.$viewHistory.histories.backView is set to null. The rest of histories data is still remaining.
The clearHistory() actually works well with the nightbuild. However, there might be another issue with the navigation menu. Please have a look.
If you check my codepen, you would easy to realise that all histories & views are stored, even though you hit the back button. They will be increasing all the time if you just navigate to the new item and hit back again. It might be a memory issue for mobile devices.
Should it clear the previous view (or history) when user hit the back button (or go back the the previous view)?