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

memory leak #314

Open
ChipArtem opened this issue Dec 19, 2023 · 1 comment
Open

memory leak #314

ChipArtem opened this issue Dec 19, 2023 · 1 comment

Comments

@ChipArtem
Copy link

For generate a loading I create goroutines.
Goroutines are created by a consumer and a producer. After these I send and read messages. Over time, my memory begins to leak.

func goConsumer(...) {
         ...
	ctx := context.TODO()
	conn, err := amqp.Dial(....)
	if err != nil {
	....
	}
	defer conn.Close()
	session, err := conn.NewSession(ctx, nil)
	if err != nil {
         ...
	}
	defer session.Close(ctx)
	consumer, err := session.NewReceiver(ctx, q.Name, nil)
	if err != nil {
	...
	}
	defer consumer.Close(ctx)
	for {
		select {
		case <-chTimer.C:
			return
		default:
			msg, err := consumer.Receive(ctx, nil)
			....
			ctx = context.TODO()
			err = consumer.AcceptMessage(ctx, msg)
			....
		}
	}
}

image
@jhendrixMSFT
Copy link
Member

jhendrixMSFT commented Jan 2, 2024

Can we please get more info on your scenario.

  • are there multiple senders/receivers?
  • are the senders/receivers short or long lived?
  • what are typical message sizes and how big is the largest message (best guess is fine)?

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

No branches or pull requests

2 participants