From 105905330ed38580dcc040e0daba992df8beaba2 Mon Sep 17 00:00:00 2001 From: James McMullan Date: Thu, 26 Oct 2023 14:33:08 -0400 Subject: [PATCH] HPCC4J-545 Resume read test causes OOM error (#651) - Updated resume read to use a smaller read buffer size Signed-off-by: James McMullan James.McMullan@lexisnexis.com Signed-off-by: James McMullan James.McMullan@lexisnexis.com --- .../java/org/hpccsystems/dfs/client/DFSReadWriteTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSReadWriteTest.java b/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSReadWriteTest.java index 2fc59c86d..e5d5fa3b1 100644 --- a/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSReadWriteTest.java +++ b/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSReadWriteTest.java @@ -178,11 +178,12 @@ public void readResumeTest() throws Exception System.out.println("Messages from file part (" + i + ") read operation:\n" + fileReader.getRemoteReadMessages()); } + int readSizeKB = 100; ArrayList resumedRecords = new ArrayList(); for (int i = 0; i < resumeInfo.size(); i++) { HPCCRecordBuilder recordBuilder = new HPCCRecordBuilder(file.getProjectedRecordDefinition()); - HpccRemoteFileReader fileReader = new HpccRemoteFileReader(fileParts[resumeFilePart.get(i)], originalRD, recordBuilder, -1, -1, true, -1, resumeInfo.get(i)); + HpccRemoteFileReader fileReader = new HpccRemoteFileReader(fileParts[resumeFilePart.get(i)], originalRD, recordBuilder, -1, -1, true, readSizeKB, resumeInfo.get(i)); if (fileReader.hasNext()) { @@ -194,6 +195,10 @@ public void readResumeTest() throws Exception resumedRecords.add(record); } + fileReader.close(); + + fileReader = null; + recordBuilder = null; } assertEquals("Number of records did not match during read resume.", records.size(), resumedRecords.size());