[ https://issues.apache.org/jira/browse/PHOENIX-2405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15307954#comment-15307954 ]
ASF GitHub Bot commented on PHOENIX-2405: ----------------------------------------- GitHub user RCheungIT opened a pull request: https://github.com/apache/phoenix/pull/171 Phoenix-2405 https://issues.apache.org/jira/browse/PHOENIX-2405 You can merge this pull request into a Git repository by running: $ git pull https://github.com/RCheungIT/phoenix PHOENIX-2405 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/phoenix/pull/171.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #171 ---- commit 86f134afb1d3e08c49fb49a8d655ab8de04be0d8 Author: Haoran Zhang <hubert.zh...@outlook.com> Date: 2016-04-22T22:41:23Z Merge pull request #1 from apache/master Merge from master commit 4598a1f082cffe709c6124361fba21760fab4d65 Author: RCheungIT <hubert.zh...@outlook.com> Date: 2016-05-27T17:12:41Z add deferredByteBufferQueue commit 16571f763858f348ea0832a23cc12cdf7cd41273 Author: RCheungIT <hubert.zh...@outlook.com> Date: 2016-05-29T15:43:35Z extract interface for buffersegment and bufferqueue commit de308b99c4485c56bc543eda7362c2d2d93d07c6 Author: RCheungIT <hubert.zh...@outlook.com> Date: 2016-05-31T15:49:14Z add memory management ---- > Improve performance and stability of server side sort for ORDER BY > ------------------------------------------------------------------ > > Key: PHOENIX-2405 > URL: https://issues.apache.org/jira/browse/PHOENIX-2405 > Project: Phoenix > Issue Type: Bug > Reporter: James Taylor > Assignee: Haoran Zhang > Labels: gsoc2016 > Fix For: 4.8.0 > > > We currently use memory mapped files to buffer data as it's being sorted in > an ORDER BY (see MappedByteBufferQueue). The following types of exceptions > have been seen to occur: > {code} > Caused by: java.lang.OutOfMemoryError: Map failed > at sun.nio.ch.FileChannelImpl.map0(Native Method) > at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:904) > {code} > [~apurtell] has read that memory mapped files are not cleaned up after very > well in Java: > {quote} > "Map failed" means the JVM ran out of virtual address space. If you search > around stack overflow for suggestions on what to do when your app (in this > case Phoenix) encounters this issue when using mapped buffers, the answers > tend toward manually cleaning up the mapped buffers or explicitly triggering > a full GC. See > http://stackoverflow.com/questions/8553158/prevent-outofmemory-when-using-java-nio-mappedbytebuffer > for example. There are apparently long standing JVM/JRE problems with > reclamation of mapped buffers. I think we may want to explore in Phoenix a > different way to achieve what the current code is doing. > {quote} > Instead of using memory mapped files, we could use heap memory, or perhaps > there are other mechanisms too. -- This message was sent by Atlassian JIRA (v6.3.4#6332)