[jira] [Created] (FLINK-11379) "java.lang.OutOfMemoryError: Direct buffer memory" when TM loads a large size TDD

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-11379) "java.lang.OutOfMemoryError: Direct buffer memory" when TM loads a large size TDD

Shang Yuanchun (Jira)
Haibo Suen created FLINK-11379:
----------------------------------

             Summary: "java.lang.OutOfMemoryError: Direct buffer memory" when TM loads a large size TDD
                 Key: FLINK-11379
                 URL: https://issues.apache.org/jira/browse/FLINK-11379
             Project: Flink
          Issue Type: Bug
          Components: TaskManager
    Affects Versions: 1.7.1, 1.7.0
            Reporter: Haibo Suen
            Assignee: Haibo Suen


When TM loads a offloaded TDD with large size, it may throw a "java.lang.OutOfMemoryError: Direct Buffer Memory" error. The loading uses nio's _Files.readAllBytes()_ to read serialized TDD. In the call stack of _Files.readAllBytes()_ , it will allocate a direct memory buffer which's size is equal the length of the file. This will cause OutOfMemoryErro error when direct memory is not enough.

A fixed size direct buffer should be used to read a file to avoid OutOfMemoryErro error, such as a 8K buffer.

The exception stack is as follows (this exception stack is from an old Flink version, but the master branch has the same problem).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)