Hi,

I've pushed a fix for a larger memory issue, mainly affecting 
effects/texture images, but also other objects. Once loaded, these stuck 
in memory until shutting down flightgear - so memory consumption was 
continually growing when flying larger distances.

Probably wasn't much of an issue initially, when we only had few or 
generic textures. Now, with lots of custom models and eye candy, we 
obviously should be able to drop stuff again.

We've discussed this about a year ago. Tim suggested using "observer 
pointers" instead of "references" in the cache maps. The discussed patch 
was never pushed to sg/next though, since I was running into stability 
issues with OSG 2.8.3. Since we don't support OSG 2.8.3 any longer, I've 
revived this again and changes are in simgear now. Keeps memory 
consumption a lot lower. I'm still seeing a slight memory growth when 
moving - but by far, it's not as bad as it was.

Simple test is to "relocate-on-ground" to a series of airport locations 
and watch process memory.

Mathias, maybe you can have a look at the simgear changes. Maybe you see 
a way to improve this even further - i.e. do we still need all these 
cache maps? Or could we simply rely on some OSG cache in some places?

cheers,
Thorsten


Am 03.05.2011 21:49, schrieb ThorstenB:
> On Mon, Apr 18, 2011 at 9:55 AM, Tim Moore<timoor...@gmail.com>  wrote:
>> On Sun, Apr 17, 2011 at 6:10 PM, ThorstenB<bre...@gmail.com>  wrote:
>>> There is
>>> a global cache in simgear/makeEffect.cxx (effectMap), and it has no
>>> condition to ever drop anything. So, created effects always stay in
>>> memory until shutdown - hence also their textures.
>>
>> It seemed like a good idea at the time :)
>> The Effect cache could be changed to use osg::observer_ptr, which is a
>> weak pointer.
>
> Good idea. Here's a patch using observers instead of references for
> caching. Puts some live into the effect/texture destructors - so these
> can finally free up some memory once the objects are no longer used
> anywhere:
> http://www.gitorious.org/~thorsten/fg/thorstenbs-simgear/commit/71d14629076b3a56c40cc0309b42b3a22d579bec



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to