Skip to content

Conversation

@caneGuy
Copy link

@caneGuy caneGuy commented Jun 8, 2018

When use NonBlockedDecompressorStream for decompress.
If we do not get any full gc for old gen.we may failed by off-heap memory leak

This patch fix this potential leak.

@caneGuy
Copy link
Author

caneGuy commented Jun 12, 2018

Can one of the owner help review this?Thanks

@rdblue
Copy link
Contributor

rdblue commented Jun 18, 2018

@caneGuy, can you fix the test failures? Also, can you more clearly describe the situation this is intended to fix and how the fix works?


private boolean finished;

private int maxBufferSize = 64 * 1024 * 1024;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this introduced?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used for reset below.We can remove this.But i think for the purpose of this patch,we should also refactor reset api.
Any suggestion?Thanks @rdblue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate more than "used for reset below"? What was the intent? Also, why do you think the reset API needs to be refactored?

@caneGuy
Copy link
Author

caneGuy commented Jun 19, 2018

Sorry, @rdblue since i can't find the actual failure test case.
This patcth fix this situation, when full gc do not happen, the buffer allocated by NonBlockedDecompressorStream will not release the off-heap memory related with this direct buffer.
Here, this patch call clean whenever the buffer can be garbage collected.

@caneGuy
Copy link
Author

caneGuy commented Jun 19, 2018

I think the failure was caused by
BUILD FAILED /home/travis/build/apache/parquet-mr/thrift-0.9.3/lib/java/build.xml:298: java.net.ConnectException: Connection timed out (Connection timed out) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589)

@wangyum
Copy link
Member

wangyum commented Jun 30, 2018

@caneGuy Can you trigger a retest?

@caneGuy
Copy link
Author

caneGuy commented Jul 4, 2018

Sorry @wangyum i don't know how to retest.Could you help trigger?
I will check the contribute document later.Thanks

@wangyum
Copy link
Member

wangyum commented Jul 5, 2018

If you are trying to build a pull-request, you can mark it closed and then mark it opened. This will trigger a new build.
travis-ci/travis-ci#576 (comment)

@caneGuy caneGuy closed this Jul 8, 2018
@caneGuy caneGuy reopened this Jul 8, 2018
@caneGuy
Copy link
Author

caneGuy commented Jul 8, 2018

Thanks @wangyum done!

@caneGuy caneGuy closed this Jul 12, 2018
@nputnam
Copy link

nputnam commented Aug 23, 2018

I was having an issue with a new service we're building that processes a bunch of snappy encoded parquet files OOM'ing. This patch seemed to resolve the issue for us. I also played around with having the cleaner only run on reset, didn't seem to resolve the issue.

@caneGuy
Copy link
Author

caneGuy commented Dec 29, 2018

May be i can refactor later @nputnam
And compressor may also have this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants