From ee55c6804deb5fd5dbf3ed1a60a0d6bb396db6e2 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Wed, 23 Dec 2020 20:30:14 -0500 Subject: [PATCH] Bug 569911: Stop allowing OOB records to accumulate forever Add a limit of 100,000 records to prevent OOM errors. Normally only a few OOB records are needed, but in some cases like with tdump, hundreds may be needed. Change-Id: I967e0facc1dc326d94fa67b1d647417ee3cd8891 --- .../cdt/dsf/mi/service/command/AbstractMIControl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java index 8db4f3b9bf3..a7b671b6182 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java @@ -1088,8 +1088,9 @@ public abstract class AbstractMIControl extends AbstractDsfService implements IM fAccumulatedOOBRecords.add(oob); // limit growth, but only if these are not responses to CLI commands - // Bug 302927 & 330608 - if (fRxCommands.isEmpty() && fAccumulatedOOBRecords.size() > 20) { + // Bug 302927 & 330608 & 569911 + if (fRxCommands.isEmpty() && fAccumulatedOOBRecords.size() > 20 + || fAccumulatedOOBRecords.size() > 100000) { fAccumulatedOOBRecords.remove(0); }