Skip to content

Conversation

@huksley
Copy link
Member

@huksley huksley commented Oct 25, 2025

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

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]>
@huksley huksley force-pushed the claude/fix-memory-leak-011CUTZ8fgu6W3XBTqtT1S26 branch from 624970f to 265ee48 Compare October 25, 2025 08:10
@huksley huksley merged commit 2fcd902 into master Oct 25, 2025
1 check passed
@huksley huksley deleted the claude/fix-memory-leak-011CUTZ8fgu6W3XBTqtT1S26 branch October 25, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSL/Syslog output cef - OOM graylog crashed

3 participants