You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by "Simo Chiegang, Boris Arthur RD-P8.1" <Bo...@heidelberg.com> on 2013/09/04 12:31:49 UTC
TextLineDecoder maxLineLength
Hi,
I want to know sometimes.
- Why is the TextLineDecoder maxLinelength defined to 1024?, it is some reason?
- When I change this to Integer.MAX_VALUE, which effect has this changes on my System regardless the memory?
Best Regard
Simo
________________________________
Confidentiality note:
The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.
Re: TextLineDecoder maxLineLength
Posted by Maarten Bosteels <mb...@gmail.com>.
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 <el...@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
>
>
Re: TextLineDecoder maxLineLength
Posted by Emmanuel Lécharny <el...@gmail.com>.
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