I am working on a pretty big app (about 70 fragments). When I click through my app, all my previous fragments are stored in the backstack. After some clicks my memory is pretty high and on old phones (Samsung S3) I get an OutOfMemory exception.
Is there a way to do something about the memory usage of the fragment backstack? I already tried to make my own backstack, it fixed the memory problem but the only problem was that it doesn't remember search terms and scrolling positions this way:
Stack<BackStackEntry> mBackStack = new Stack<>();
mBackStack.add(new BackStackEntry(tag, fragment.getClass()));