Prevent Logstash/JVM from shutting down when memory usage is high

Besides using a buffer like Kafka or increasing the memory on the machines. Is there a way to prevent Logstash from using too much memory and shutting down. For example, have it make input plugins stop accepting new messages until it has memory to continue.

How does it shutdown, can you show logs?

I do not have my own logs ATM. But the logs were something along the lines of:

Error: Your application used more memory than the safety cap of 4G.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

That looks like the OS stopping Logstash, not Logstash stopping itself.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.