[rabbitmq-discuss] |Spam| Memory usage about java client?

yaohui 176047528 at qq.com
Thu Dec 30 11:56:47 GMT 2010


hi,
  
    My java client would use memory of JVM that i defined  by -Xms512m -Xmm512m. Is that normal?
 someon tell me the reason. There exist another methode of client not using loop while(true)?
  
 thx.
  
 my code is like this:
   Connection conn = null;
  ConnectionFactory factory = new ConnectionFactory();
   factory.setHost("localhost");
   conn = factory.newConnection();
  Channel chan = conn.createChannel();
  
   chan.queueDeclare("your_queue" , false, false, false, null);
  QueueingConsumer consumer = new QueueingConsumer(chan);
  chan.basicConsume("your_queue", true, consumer);
  
   while (true) {
    try {
       delivery = consumer.nextDelivery();
       byte msg[] = delivery.getBody();
 
     } catch (InterruptedException ie) {
       System.out.println("Error: " + ie);
       continue;
    }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20101230/f67de7d6/attachment.htm>


More information about the rabbitmq-discuss mailing list