mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 17:12:40 +01:00
DroidFish: Limit the maximum size of the engine to GUI receive buffer.
This prevents out of memory crashes when using a network engine connected to a 24 core machine running in MultiPV=100 mode.
This commit is contained in:
@@ -21,6 +21,12 @@ public class LocalPipe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final synchronized void addLine(String line) {
|
public final synchronized void addLine(String line) {
|
||||||
|
while (lines.size() > 10000) {
|
||||||
|
try {
|
||||||
|
wait(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
lines.add(line);
|
lines.add(line);
|
||||||
notify();
|
notify();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user