hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giovanni Matteo Fumarola (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-16282) Avoid FileStream to improve performance
Date Wed, 01 May 2019 18:26:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-16282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16831162#comment-16831162
] 

Giovanni Matteo Fumarola commented on HADOOP-16282:
---------------------------------------------------

Thanks [~ayushtkn]. 
My only concern remain on the exception handling.
{code:java}
// Old code
try {
	fReader = new InputStreamReader(
	new FileInputStream(procfsMemFile), Charset.forName("UTF-8"));
	in = new BufferedReader(fReader);
} catch (FileNotFoundException f) {
{code}
What instruction(s) or part of it can throw FileNotFoundExc?
{code:java}
// New code
try {
	fReader = new InputStreamReader(
	Files.newInputStream(Paths.get(procfsMemFile)),
		Charset.forName("UTF-8"));
	in = new BufferedReader(fReader);
} catch (IOException f) {
{code}
What instruction(s) or part of it can throw IOException?

 

> Avoid FileStream to improve performance
> ---------------------------------------
>
>                 Key: HADOOP-16282
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16282
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>         Attachments: HADOOP-16282-01.patch, HADOOP-16282-02.patch
>
>
> The FileInputStream and FileOutputStream classes contains a finalizer method which will
cause garbage collection pauses. See [JDK-8080225|https://bugs.openjdk.java.net/browse/JDK-8080225]
for details.
> The FileReader and FileWriter constructors instantiate FileInputStream and FileOutputStream,
again causing garbage collection issues while finalizer methods are called.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message