Actually, I think you would make your application vulnerable to an OOM
attack:  when someone keeps sending you text without ever sending a
newline, the decoder will buffer all this data in memory until you run out
of heap space.

I did not check recently, but that's what I think could happen.

regards
Maarten


On Wed, Sep 4, 2013 at 1:34 PM, Emmanuel Lécharny <elecha...@gmail.com>wrote:

> Le 9/4/13 12:31 PM, Simo Chiegang, Boris Arthur RD-P8.1 a écrit :
> > Hi,
> >
> > I want to know sometimes.
> >
> > -    Why is the TextLineDecoder maxLinelength defined to 1024?, it is
> some reason?
>
> It was more likely to be accurate than, say, 42 ;-) On other words, this
> is a purely arbitrary length. When dealing with text lines, usually they
> are below 80 or 120 chars log, with 1024 we have some margin.
>
> Note that this is configurable.
> >
> > -    When I change this to Integer.MAX_VALUE, which effect has this
> changes on my System regardless the memory?
>
> Nothing special will happen, except that you will put a lot of stress on
> your VM GC.
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Reply via email to