[
https://issues.apache.org/jira/browse/HADOOP-8361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268790#comment-13268790
]
Colin Patrick McCabe commented on HADOOP-8361:
----------------------------------------------
basically, the "real" limits look like this:
Path length: On Linux, PATH_MAX is 4096
On HDFS:, we limit the path length to HdfsConstants.MAX_PATH_LENGTH, which is
8000 UCS-2 code points, or 24000 UTF-8 bytes.
Username length: On some versions of Linux, this is 64. On others, it's 128.
I think it's 256 on Windows, but I'm not sure.
So basically, all of these things are far, far shorter than a megabyte. A
megabyte is just a convenient sanity check size. Remember that this is common
code, so we need to support all platforms and configurations.
P.S. on second thought, ACLs aren't used in HDFS, so let's drop that from the
patch for now.
> avoid out-of-memory problems when deserializing strings
> -------------------------------------------------------
>
> Key: HADOOP-8361
> URL: https://issues.apache.org/jira/browse/HADOOP-8361
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Colin Patrick McCabe
> Assignee: Colin Patrick McCabe
> Priority: Minor
> Attachments: HADOOP-8361.001.patch, HADOOP-8361.002.patch
>
>
> In HDFS, we want to be able to read the edit log without crashing on an OOM
> condition. Unfortunately, we currently cannot do this, because there are no
> limits on the length of certain data types we pull from the edit log. We
> often read strings without setting any upper limit on the length we're
> prepared to accept.
> It's not that we don't have limits on strings-- for example, HDFS limits the
> maximum path length to 8000 UCS-2 characters. Linux limits the maximum user
> name length to either 64 or 128 bytes, depending on what version you are
> running. It's just that we're not exposing these limits to the
> deserialization functions that need to be aware of them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira