To be fair, we are making OpenMW in such a way as to use as much modern technology and techniques as possible to help improve the look and feel of Morrowind. As a result, OpenMW will use more resources than what Morrowind ever did.
Do not assume that OpenMW will use the same or less resources than Morrowind, though that would be nice.
Resource Manager for memory
- psi29a
- Posts: 5362
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Resource Manager for memory
No for sure not i know that. But i had 60% and more ram usage with 4gb ram only for openmw. ^^
And it could growong further.
And it could growong further.
Re: Resource Manager for memory
This is a known issue, but AFAIK no one's been able to pin down what's leaking (there was apparently a VBO leak with MyGUI that was worked around not too long ago, but I don't think that's all of it). But rest assured, Ogre already does resource management like this with models and textures, and we have something similar in place for sounds.Ranomier wrote:i can try to create something, but if im looking on my ram usage, it is biiig and it gets bigger during playing.
NIF files currently use a temporary cache (IIRC they stay loaded while a cell transition occurs, but then get released when finished), but they could perhaps benefit from being turned into an Ogre Resource (so they can remain loaded between transitions, its data can be shared directly instead of copied (e.g. the keyframe/animation data), and get freed automatically when they're not needed and a memory budget/limit is reached).
Re: Resource Manager for memory
That sounds like a very interesting idea.but they could perhaps benefit from being turned into an Ogre Resource (so they can remain loaded between transitions, its data can be shared directly instead of copied (e.g. the keyframe/animation data), and get freed automatically when they're not needed and a memory budget/limit is reached).
Re: Resource Manager for memory
The concept sounds good, but a custom implementation would be better than an Ogre resource. Ogre resource managers don't have any notion of when a resource was last accessed, so when it hits the budget limit it'll just randomly unload something that's unused, and we can't really mark NIF files as "used", when they're only ever used during cell transitions.
Last edited by scrawl on 18 Jun 2014, 22:59, edited 1 time in total.
- psi29a
- Posts: 5362
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Resource Manager for memory
That is very ugly... I would expect some type of last-used data being used per resource, as to semi-intelligently pick things that haven't been touched in awhile. Who thought that randomly picking something was a good idea?scrawl wrote:The concept sounds good, but a custom implementation would be better than an Ogre resource. Ogre resource managers don't have any notion of when a resource was last accessed, so when it hits the budget limit it'll just randomly unload something that's unused, and we can't really mark NIF files as "used".
Re: Resource Manager for memory
It's just part of Ogre's design. Neither the resource or resource manager knows when it was used, just whether it's currently being used, so when it unloads unused resources it can't check when it was last used. It would need to set a last-used timestamp whenever decrementing a resource's refcount, so when it searches for resources with no external references it can compare timestamps and remove the ones with the earliest times. But the way resource handles are managed doesn't make that easy because the resource handle is just a typedef for SharedPtr<resource_type> -- the resource itself doesn't manage a refcount so can't set a timestamp when it changes.psi29a wrote:That is very ugly... I would expect some type of last-used data being used per resource, as to semi-intelligently pick things that haven't been touched in awhile. Who thought that randomly picking something was a good idea?
Re: Resource Manager for memory
Actually, we don't really need the last used approach, since we have a world structure that is rather rigid It would make way more sense to extrapolate which cells may become active in the near future, list all resources for these and throw out any other resources, when we are at capacity.
-
- Posts: 36
- Joined: 15 Sep 2013, 16:00
- Location: ...here?
Re: Resource Manager for memory
Out of curiosity, what kind of logic do you have in mind? The cell you're in and any next to it? Maybe cells linked to by nearby doors?Zini wrote:Actually, we don't really need the last used approach, since we have a world structure that is rather rigid It would make way more sense to extrapolate which cells may become active in the near future, list all resources for these and throw out any other resources, when we are at capacity.
Re: Resource Manager for memory
Something like that. But also considering the distance from the cell border/the door plus maybe some other things that I have not thought of yet.