4 ms·
Yes, well, I think you're right it's a lot about the contract of the API and the expectation of the user. I'd certainly want intelligence (either by the user o
by cmrdporcupine 3y ago
Yes, well, I think you're right it's a lot about the contract of the API and the expectation of the user.
I'd certainly want intelligence (either by the user or by the framework) in how frequently you release pages back to the OS.
But the DONTNEED is really not the core of the value. It's being able to create vectors that don't fragment as badly.
And yes, you're right a decent allocator could help with this, and what I'm describing is really just a kind of specialized allocator.
- vlovich123 3y agoI don’t follow. Fragmentation wasn’t the problem here - it’s that an optimization to trying to reuse the underlying allocation resulted in a severe over-allocation in a specific path. That would happen even with your idea unless you use DONTNEED to release all the unused pages. I think fragmentation is an over focused on problem when in practice it’s rarely the problem. It’s also a problem that can be solved by an application reset and making sure to periodically reset your running application in a way that doesn’t result in severe disruption is a better practice that works around many more issues than just fragmentation.