Skip to content

Commit

Permalink
[core] Remove deleteOnExit method to avoid out of memory
Browse files Browse the repository at this point in the history
  • Loading branch information
仟弋 committed Sep 10, 2024
1 parent d56a6cf commit 6f02a4c
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ public Context close() throws IOException {
// Write bloom filter file
if (bloomFilter != null) {
File bloomFilterFile = new File(tempFolder, "bloomfilter.dat");
bloomFilterFile.deleteOnExit();
try (FileOutputStream bfOutputStream = new FileOutputStream(bloomFilterFile)) {
bfOutputStream.write(bloomFilter.getBuffer().getArray());
LOG.info("Bloom filter size: {} bytes", bloomFilter.getBuffer().size());
Expand Down Expand Up @@ -459,7 +458,6 @@ private DataOutputStream getDataStream(int keyLength) throws IOException {
DataOutputStream dos = dataStreams[keyLength];
if (dos == null) {
File file = new File(tempFolder, "data" + keyLength + ".dat");
file.deleteOnExit();
dataFiles[keyLength] = file;

dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
Expand Down Expand Up @@ -488,7 +486,6 @@ private DataOutputStream getIndexStream(int keyLength) throws IOException {
DataOutputStream dos = indexStreams[keyLength];
if (dos == null) {
File file = new File(tempFolder, "temp_index" + keyLength + ".dat");
file.deleteOnExit();
indexFiles[keyLength] = file;

dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
Expand Down

0 comments on commit 6f02a4c

Please sign in to comment.