(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.
This commit is contained in:
Viktor Lofgren 2023-12-18 13:42:40 +01:00
parent d02bed1a55
commit 126ac3816f

View File

@ -25,7 +25,7 @@ public class ConverterWriter implements AutoCloseable {
private final Duration switchInterval private final Duration switchInterval
= Duration.of(10, ChronoUnit.MINUTES); = Duration.of(10, ChronoUnit.MINUTES);
private final ArrayBlockingQueue<ProcessedDomain> domainData private final ArrayBlockingQueue<ProcessedDomain> domainData
= new ArrayBlockingQueue<>(4); = new ArrayBlockingQueue<>(1);
private final Thread workerThread; private final Thread workerThread;