You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix memory leak by limiting internal message queue size
This commit addresses GitHub issue #61 where memory usage keeps increasing
and garbage collection fails, eventually causing node crashes after several days.
Root Cause:
The syslog4j library queues messages internally with no limit by default when
using TCP/SSL protocols. Under high message throughput, this causes unbounded
memory growth leading to OOM errors.
Solution:
1. Added maxQueueSize configuration parameter (default: 500 messages)
2. Set maxQueueSize on all syslog config objects (UDP/TCP/SSL)
3. Made the parameter user-configurable through Graylog UI
The conservative default of 500 prevents memory leaks while still allowing
reasonable buffering. Users experiencing high throughput can tune this value
based on their needs, but should avoid unlimited queuing (-1).
When the queue is full, the plugin will block until space is available,
providing natural backpressure instead of consuming all available memory.
Configuration:
- Default: 500 messages
- Configurable via "Maximum queue size" field in output configuration
- Set to -1 for unlimited (not recommended, will cause OOM)
Fixes#61
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
@@ -320,6 +334,8 @@ public ConfigurationRequest getRequestedConfiguration() {
320
334
321
335
configurationRequest.addField(newTextField("maxlen", "Maximum message length", "", "Maximum message (body) length. Longer messages will be truncated. If not specified defaults to 16384 bytes.", ConfigurationField.Optional.OPTIONAL));
322
336
337
+
configurationRequest.addField(newTextField("maxQueueSize", "Maximum queue size", "500", "Maximum number of messages to queue internally before blocking (prevents OOM). Set to -1 for unlimited (not recommended). Default is 500.", ConfigurationField.Optional.OPTIONAL));
338
+
323
339
configurationRequest.addField(newTextField("keystore", "Key store", "", "Path to Java keystore (required for SSL over TCP). Must contain private key and cert for this client.", ConfigurationField.Optional.OPTIONAL));
324
340
configurationRequest.addField(newTextField("keystorePassword", "Key store password", "", "", ConfigurationField.Optional.OPTIONAL));
0 commit comments