Open ChipArtem opened 8 months ago
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) .... } } }
Can we please get more info on your scenario.
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.