Skip to content

Conversation

@ffbin
Copy link
Contributor

@ffbin ffbin commented Aug 3, 2015

When closeConnection, should call dataOutputStream.close() instead of dataOutputStream.flush() because close() will call flush() first and then releases any system resources associated with this stream. Only call dataOutputStream.flush() cause memory leak.

@StephanEwen
Copy link
Contributor

Merging this...

@StephanEwen
Copy link
Contributor

BTW: All of these things are not memory leaks. Java always closes the streams when the objects are garbage collected.

It is simply good practice to close them as early as possible.

StephanEwen pushed a commit to StephanEwen/flink that referenced this pull request Aug 3, 2015
@asfgit asfgit closed this in b08e30a Aug 3, 2015
@chenliang613
Copy link
Contributor

@StephanEwen
ffbin is good at C and C++, so he is very care about JVM issues.
As we know, Flink's memory management is a significant feature to control very precisely how much memory used for improving system efficiency.(This is also why Spark 1.5 is working Tungsten project for it). so a number of similar small changes may achieve some meaningful result.

@StephanEwen
Copy link
Contributor

Agreed, it is good to fix these things, that's why I merge them.

nikste pushed a commit to nikste/flink that referenced this pull request Sep 29, 2015
nltran pushed a commit to nltran/flink that referenced this pull request Jan 8, 2016
pnowojski pushed a commit that referenced this pull request Jul 3, 2024
[MATRIX-213] Min max scalar function Implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants