[Bf-committers] PATCH to limit memory usage in sequencer

Ton Roosendaal ton at blender.org
Mon Oct 24 17:15:01 CEST 2005


Hi,

A good memory cache limitor we could use very well! I'm just quite  
confused with the implementation... the API for it has no comments  
included either.

For example, in the sequence.c code you added this in a row;

+					IMB_cache_limiter_insert(se->ibuf);
+					IMB_cache_limiter_ref(se->ibuf);
+					IMB_cache_limiter_touch(se->ibuf);

What is each call doing?

I'm also not very fond of invisible STL memory management, in Blender  
we use our secure MEM_mallocN almost everywhere, which as saved us in a  
lot of situations. Could you use that too?

Then, knowing sequencer quite well, the current implementation was  
never aimed at allowing longer videos to edit... it has quite some  
design flaws which we could tackle too, for example by freeing up  
memory of strips get layered (only the end result needs storage).
This is worth testing too.

I would also like to know if such a cache system is what other video  
edit programs use too? The current speed bottleneck is also that  
calculation of effects just takes cpu time, making it not realtime.

Anyhoo, very encouraging work! :)

-Ton-


On 18 Oct, 2005, at 20:12, Peter Schlaile wrote:

> Hello,
>
> I just added a patch to the patch tracker for those, who want to use
> blender as an NLA-editor for longer movies then a few seconds.
>
> This patch limits the memory usage in the sequencer by throwing out
> the oldest cached ImBufs.
>
> It also implements a generic Mem Cache Limiter framework written in C++
> with an additional C interface used by the Imbuf cache limiter.
>
> The upper memory cache limit is hard coded to 32 MB for the moment -
> I'll add an userpref entry later.
>
> This patch is needed by those who want to use blender as an NLA
> video editor for longer sequences (say 15 minutes e.g. or longer if
> someone raises the frame limit.)
>
> The upper memory limit is a _soft_ limit. If the sequence renderer
> temporarily needs more memory then it is granted. If you want to
> test this the hard way, set the memory limit in the source file
> (MEM_CacheLimiterC-Api.cpp) to 1 byte. It should still work - blender
> will be very slow - but it should work.
>
> Setting the limit to 0 bytes disables the cache limit completely and
> blender will eat memory like popcorn again.
>
> Any suggestions are always welcome!
>
> Greetings,
> Peter Schlaile
>
>
>
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list