From 126ac3816f100d33ffa566577ca7c82d9fa689df Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Mon, 18 Dec 2023 13:42:40 +0100 Subject: [PATCH] (converter) Reduce queue size in ConverterWriter The size of the ArrayBlockingQueue in ConverterWriter.java has been reduced from 4 to 1. This change aims to reduce the memory utilization by not having fully processed domains piling up in RAM. This may cause the writer to go idle in waiting for new data, but that may be preferable to an OOM. --- .../java/nu/marginalia/converting/writer/ConverterWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/processes/converting-process/src/main/java/nu/marginalia/converting/writer/ConverterWriter.java b/code/processes/converting-process/src/main/java/nu/marginalia/converting/writer/ConverterWriter.java index 3069c5ed..6cb4f332 100644 --- a/code/processes/converting-process/src/main/java/nu/marginalia/converting/writer/ConverterWriter.java +++ b/code/processes/converting-process/src/main/java/nu/marginalia/converting/writer/ConverterWriter.java @@ -25,7 +25,7 @@ public class ConverterWriter implements AutoCloseable { private final Duration switchInterval = Duration.of(10, ChronoUnit.MINUTES); private final ArrayBlockingQueue domainData - = new ArrayBlockingQueue<>(4); + = new ArrayBlockingQueue<>(1); private final Thread workerThread;