Dirty fix for OutOfMemory errors

Limit segment queue to 50 segments. This keeps memory consumption down in case of too low disk IO speed at the expense of recordings restarting and unwritten segments getting dropped.
This commit is contained in:
reusedname 2025-02-15 15:15:12 +05:00
parent 7e5e7d2cb1
commit 0ae1a3b452
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
protected FFmpeg ffmpeg;
protected Process ffmpegProcess;
protected OutputStream ffmpegStdIn;
protected BlockingQueue<Future<SegmentDownload>> queue = new LinkedBlockingQueue<>();
protected BlockingQueue<Future<SegmentDownload>> queue = new LinkedBlockingQueue<>(50);
protected Lock ffmpegStreamLock = new ReentrantLock();
public String getStats() {