You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Saurabh Chandra <ch...@gmail.com> on 2006/07/22 08:30:43 UTC

Memory usage increasing

Hello,

I was facing some memory issues with our activeMQ app. The memory
usage increased and byte [] instances are not getting released. I did
some investigation using jrockit memleak and am attaching screenshots
of memory increase (hourly), instance counts and ref graph. The ref
graph points to ActiveMQTextMessage and then to a linked list which is
self referring. I don't have any linked lists in the code that has
been written but there is a static string - could that be a culprit?

As can be seen in the graph the memory did become stable finally.
Could it be "normal" behavior that we should not be alarmed about?

The code being invoked is pretty simple right now -

//Consumer code
public void onMessage(Message msg) {
		logger.debug("######Recieved:"+msg.toString());
		try {
			FeedValue.setFeed(((TextMessage)msg).getText());
			logger.debug("Recieved and FeedValue set ");
		} catch (JMSException e) {
			// e.printStackTrace();
			logger.error("There was a JMSException: ",e.fillInStackTrace());
		}
}

//FeedValue Class
public class FeedValue {
	
	private static String feed = "";
	
	public static String getFeed() {
		return feed;
	}
	
	public static void setFeed(String feed) {
		FeedValue.feed = feed;
	}

}

Using activeMQ 4.0 and JDK 1.5. ActiveMQ is configured as an embedded
broker on Tomcat 5.5 using spring to configure it.

regards
Saurabh

Re: Memory usage increasing

Posted by James Strachan <ja...@gmail.com>.
Its a bit hard to know for certain from the information available but
the default behaviour of ActiveMQ is to use a prefetch buffer of
messages on the client for performance; so there will be lots of
messages kept around in RAM for each consumer by default...

http://incubator.apache.org/activemq/what-is-the-prefetch-limit-for.html

If you can get your application to a steady state and the amount of
RAM used reaches a consistent level then I'd say there's no leak.


On 7/22/06, Saurabh Chandra <ch...@gmail.com> wrote:
> Sorry, forgot that attachments won't work on the mailing list. I have
> uploaded the screenshots here:
> http://picasaweb.google.com/chandrasaurabh/MemScreenshots
>
> regards
> Saurabh
>
> On 7/22/06, Saurabh Chandra <ch...@gmail.com> wrote:
> > Hello,
> >
> > I was facing some memory issues with our activeMQ app. The memory
> > usage increased and byte [] instances are not getting released. I did
> > some investigation using jrockit memleak and am attaching screenshots
> > of memory increase (hourly), instance counts and ref graph. The ref
> > graph points to ActiveMQTextMessage and then to a linked list which is
> > self referring. I don't have any linked lists in the code that has
> > been written but there is a static string - could that be a culprit?
> >
> > As can be seen in the graph the memory did become stable finally.
> > Could it be "normal" behavior that we should not be alarmed about?
> >
> > The code being invoked is pretty simple right now -
> >
> > //Consumer code
> > public void onMessage(Message msg) {
> >                 logger.debug("######Recieved:"+msg.toString());
> >                 try {
> >                         FeedValue.setFeed(((TextMessage)msg).getText());
> >                         logger.debug("Recieved and FeedValue set ");
> >                 } catch (JMSException e) {
> >                         // e.printStackTrace();
> >                         logger.error("There was a JMSException: ",e.fillInStackTrace());
> >                 }
> > }
> >
> > //FeedValue Class
> > public class FeedValue {
> >
> >         private static String feed = "";
> >
> >         public static String getFeed() {
> >                 return feed;
> >         }
> >
> >         public static void setFeed(String feed) {
> >                 FeedValue.feed = feed;
> >         }
> >
> > }
> >
> > Using activeMQ 4.0 and JDK 1.5. ActiveMQ is configured as an embedded
> > broker on Tomcat 5.5 using spring to configure it.
> >
> > regards
> > Saurabh
> >
> >
> >
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Memory usage increasing

Posted by Saurabh Chandra <ch...@gmail.com>.
Sorry, forgot that attachments won't work on the mailing list. I have
uploaded the screenshots here:
http://picasaweb.google.com/chandrasaurabh/MemScreenshots

regards
Saurabh

On 7/22/06, Saurabh Chandra <ch...@gmail.com> wrote:
> Hello,
>
> I was facing some memory issues with our activeMQ app. The memory
> usage increased and byte [] instances are not getting released. I did
> some investigation using jrockit memleak and am attaching screenshots
> of memory increase (hourly), instance counts and ref graph. The ref
> graph points to ActiveMQTextMessage and then to a linked list which is
> self referring. I don't have any linked lists in the code that has
> been written but there is a static string - could that be a culprit?
>
> As can be seen in the graph the memory did become stable finally.
> Could it be "normal" behavior that we should not be alarmed about?
>
> The code being invoked is pretty simple right now -
>
> //Consumer code
> public void onMessage(Message msg) {
>                 logger.debug("######Recieved:"+msg.toString());
>                 try {
>                         FeedValue.setFeed(((TextMessage)msg).getText());
>                         logger.debug("Recieved and FeedValue set ");
>                 } catch (JMSException e) {
>                         // e.printStackTrace();
>                         logger.error("There was a JMSException: ",e.fillInStackTrace());
>                 }
> }
>
> //FeedValue Class
> public class FeedValue {
>
>         private static String feed = "";
>
>         public static String getFeed() {
>                 return feed;
>         }
>
>         public static void setFeed(String feed) {
>                 FeedValue.feed = feed;
>         }
>
> }
>
> Using activeMQ 4.0 and JDK 1.5. ActiveMQ is configured as an embedded
> broker on Tomcat 5.5 using spring to configure it.
>
> regards
> Saurabh
>
>
>