Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a single ActiveMQ session per connection, to prevent OOM errors #205

Open
wants to merge 8 commits into
base: GROUPER_2_6_BRANCH
Choose a base branch
from

Conversation

stevehillman
Copy link
Contributor

This PR changes the ActiveMQ ChangeLog processor to only create one ActiveMQ session per Connection, rather than one per message. Each AMQ Session starts a new thread, and the "one per message" model was causing OOM errors when large changes were processed.

Each created Session spawns a thread to handle message transmission.
Prior to this change, each change resulted in a new thread being
created. If the ChangeLog had a large number of pending changes
(10s of thousands), memory starvation occurred. This change serializes
message transmission
- The previous behaviour used a separate session in the ActiveMQ client
  library for each message being sent. Each session spawns two threads. If
  a Change Log update involved too many changes, memory exhaustion could
  occur.

The old behaviour can be restored by setting

  grouper.messaging.system.activeMqMessaging.useSharedSession = false

in grouper.client.properties
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.

1 participant