Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC4J-545 Resume read test causes OOM error #649

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public void readResumeTest() throws Exception
System.out.println("Messages from file part (" + i + ") read operation:\n" + fileReader.getRemoteReadMessages());
}

Runtime runtime = Runtime.getRuntime();
ArrayList<HPCCRecord> resumedRecords = new ArrayList<HPCCRecord>();
for (int i = 0; i < resumeInfo.size(); i++)
{
Expand All @@ -194,6 +195,13 @@ public void readResumeTest() throws Exception

resumedRecords.add(record);
}

// Periodically run garbage collector to prevent buffers in remote file readers from exhausting free memory
// This is only needed due to rapidly creating / destroying thousands of HpccRemoteFileReaders
if ((i % 10) == 0)
{
runtime.gc();
}
}

assertEquals("Number of records did not match during read resume.", records.size(), resumedRecords.size());
Expand Down
Loading