[vlc-devel] [PATCH] access: dvb: Realloc block to actually used size.

Julian Scheel julian at jusst.de
Tue Sep 24 15:44:49 CEST 2013


Am 24.09.2013 15:07, schrieb Rémi Denis-Courmont:
> On Tue, 24 Sep 2013 14:59:02 +0200, Julian Scheel <julian at jusst.de> wrote:
>> The realloc caused packet loss?
>
> The performance problem caused packet loss and reallocation contributes to
> it.
>
>> Why that?
>
> Reallocation requires memory copying in most cases, and extra heap
> processing.

Shouldn't a good realloc implementation be able to just free left over 
memory without copying everything, as long as the target size is less 
than the original size? The only reason for copying I'd see there would 
be if the implementation tries to avoid memory fragmentation...

>> I see that a too small buffer size would cause packet loss,
>
> Eventually the kernel side buffers fill up and overflow. Data gets lost.
> It works the same way for DVB or UDP. It is a little bit more subtle for
> TCP.

Ok, so the issue you describes exists with the current UDP access 
module? I have not seen it myself running on not actually powerful systems.

What would you think about the approach we discussed before where we 
allocate memory dynamically due to previous readback size?

-Julian



More information about the vlc-devel mailing list