Skip to content

Commit

Permalink
HDDS-11635. Memory leak when using Ozone FS via Hadoop FileContext API (
Browse files Browse the repository at this point in the history
  • Loading branch information
aekom87 authored Nov 1, 2024
1 parent c9956a1 commit c7a196f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ public BasicOzFs(URI theUri, Configuration conf)
public int getUriDefaultPort() {
return -1;
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@ public OzFs(URI theUri, Configuration conf)
public int getUriDefaultPort() {
return -1;
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ public RootedOzFs(URI theUri, Configuration conf)
public int getUriDefaultPort() {
return -1;
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,13 @@ public OzFs(URI theUri, Configuration conf)
super(theUri, new OzoneFileSystem(), conf,
OzoneConsts.OZONE_URI_SCHEME, false);
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ public RootedOzFs(URI theUri, Configuration conf)
super(theUri, new RootedOzoneFileSystem(), conf,
OzoneConsts.OZONE_OFS_URI_SCHEME, false);
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ public OzFs(URI theUri, Configuration conf)
super(theUri, new OzoneFileSystem(), conf,
OzoneConsts.OZONE_URI_SCHEME, false);
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ public RootedOzFs(URI theUri, Configuration conf)
super(theUri, new RootedOzoneFileSystem(), conf,
OzoneConsts.OZONE_OFS_URI_SCHEME, false);
}

/**
* Close the file system; the FileContext API doesn't have an explicit close.
*/
@Override
protected void finalize() throws Throwable {
fsImpl.close();
super.finalize();
}
}

0 comments on commit c7a196f

Please sign in to comment.