New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to disable in-memory NSCache #1130
Conversation
This is a workaround for #538. NSCache truly is the problem and by disabling it, memory spikes are completely eliminated. Some may argue that it's OK for NSCache to balloon since that device memory is "available" to be used by a cache, but as your foreground app consumes memory, it will cause apps in the background to receive warnings and to be exited. I'd rather my app be a good citizen by not ballooning in the first place. FWIW, setting the max cache cost to zero also doesn't prevent those huge spikes; disabling NSCache is the only way to achieve the memory behavior that my app needs. |
@mallorypaine thanks for jumping over to this project and for this PR 👍 This has been plaguing this project for a long time now. |
I implemented this in my local branch just to test and it didn't fix the |
@KiranPanesar seems to be working for me. @mallorypaine do you know what this means in terms of performance in FPS on a standard scrollview? About to do some profiling, but just wondering if you knew off hand? |
@rromanchuk it will have zero impact on the scrollview's scrolling performance in terms of frame rate. the only impact this change will have is that images will take longer to load (and appear in your scrollview) since they aren't being stored in the cache. |
@mallorypaine makes sense, thx |
I've implemented this change and have verified that the images are never loaded from memory, but I'm still getting the spikes (sometimes 100MB+) when some images are first loaded into the imageviews in my tableview. |
@mallorypaine just anecdotally, turning NSCache off fixes the memory problem for me, but there is an obvious new animation stutter when scrolling (fullscreen paging), but i'm sure it's just a developer error that was conveniently being hidden under the surface which is now being exacerbated now that NSCache is turned off |
Guys, really appreciate the work here. We have replaced this with a mergeable solution #1217 |
No description provided.