[rabbitmq-discuss] Garbage Collection Problem in Consumer

Gustavo Aquino aquino.gustavo at gmail.com
Tue Feb 2 11:31:50 GMT 2010


You can't control when your GC will run, if you declare this objects into
loop and don't are using hash tables or maps to reutilize it, so it will
be eligible to GC automatically, because your life cycle over in next loop.

Today I have a consumer in Java consuming about 1.000 m/s and never used
more than 15Mb and this objects never go throw eden memory, if you don't
forward this objects created inside consumer loop, this objects will be
automatic eligible for GC but GC don't run immediately you need to wait.

Can you post your consumer code ?

On Tue, Feb 2, 2010 at 3:48 AM, Seema Biradar <seemasbiradar at gmail.com>wrote:

> Hi All,
> i tried the rabbit MQ with Producer and Consumer Program.
> in Consumer side i am getting the all the Message, but the following
> objects
> com.rabbitmq.client.QueueingConsumer.Delivery
> com.rabbitmq.client.Envelop
> com.rabbitmq.client.AMQP.BasicProperties
> are created for each message and not garbage collected immediately after
> consuming.
> *in Producer.java
> *
> used basic publish as shown below.
> channel.basicPublish(exchangeName, routingKey, true, false,
> MessageProperties.PERSISTENT_TEXT_PLAIN, bao.toByteArray()) ;
> *Consumer.java
> *
> channel.basicConsume(queueName, true, consumer);
> with no-acknowledgement *true*.
> Please let me know, how to make the above object eligible for garbage
> collection immediately after consuming.
> for Consumer program The Heap Memory allocated is more , as this is
> performace issue
> Thanks,
> Seema
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100202/e73e5e6c/attachment.htm 

More information about the rabbitmq-discuss mailing list