activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilia Stepanov (JIRA)" <>
Subject [jira] [Commented] (AMQ-4487) java.lang.OutOfMemoryError: Java heap space
Date Mon, 20 May 2013 19:19:16 GMT


Ilia Stepanov commented on AMQ-4487:

I have same issue with 5.8.0. I checked the heap dump and debugged the web console, hope this
will help to fix it. Please provide an update.

In the heap dump I found an instance of VMPendingMessageCursor holding 18+ millions of PendingNode
elements (the queue had actually just two hundreds message). 

I did debugging - the method Queue.iterate() is repeated in an endless loop.

In first run it adds 200 messages to the browser. The second run should normally add no new
messages and remove the browserDispatch from the browserDispatches. However this does not
- the if (!node.isAcked() && !browser.getPending().getMessageAudit().isDuplicate(node.getMessageId()))
 returns true again and messages are added again. 

The third run adds messages again and so on. Messages are added until OOM occurs.
I found it strange that method ActiveMQMessageAuditNoSync.isDuplicate() returns false in the
second iteration and checked it. 

    public boolean isDuplicate(final MessageId id) {
        boolean answer = false;

        if (id != null) {
            ProducerId pid = id.getProducerId();
            if (pid != null) {
                BitArrayBin bab = map.get(pid);  << here the bab is null in the second
iteration. why? it should been added in the first iteration
                if (bab == null) {
                    bab = new BitArrayBin(auditDepth);
                    map.put(pid, bab);           << here new entry is added to the map,
but the size of keySet() is NOT increased!
                    modified = true;             << here  map.get(pid) returns a coorect
value in the debugger. 
						 << However in the next iteration it returns null again...
                answer = bab.setBit(id.getProducerSequenceId(), true);
        return answer;
It looks like a collision in the map. Does ProducerId comes with a proper hashCode() and equals()

> java.lang.OutOfMemoryError: Java heap space
> -------------------------------------------
>                 Key: AMQ-4487
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.8.0
>         Environment: OS - Linux 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64
x86_64 x86_64 GNU/Linux
> Activemq - 5.8
>            Reporter: Subathra Jayaraman
> Hi,
> When we browse a queue in webconsole we are getting java.lang.OutOfMemoryError: Java
heap space. 
> Memory allocation -----> -Xms512m -Xmx3G
> When we try to click the queue to view the messages below error is occurring. We recently
moved from 5.7 to 5.8 version. We dint face this issue in 5.7 version.
> Kindly help in fixing the issue.
> java.lang.OutOfMemoryError: Java heap space
>         at java.util.Arrays.copyOf(
>         at
>         at
>         at com.opensymphony.module.sitemesh.filter.RoutablePrintWriter.write(
>         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(
>         at org.apache.jasper.runtime.JspWriterImpl.write(
>         at org.apache.jasper.runtime.JspWriterImpl.write(
>         at org.apache.jsp.browse_jsp$browse_jspHelper.invoke0(org.apache.jsp.browse_jsp:382)
>         at org.apache.jsp.browse_jsp$browse_jspHelper.invoke(org.apache.jsp.browse_jsp:450)
>         at org.apache.jsp.tag.web.jms.forEachMessage_tag.doTag(org.apache.jsp.tag.web.jms.forEachMessage_tag:89)
>         at org.apache.jsp.browse_jsp._jspx_meth_jms_forEachMessage_0(org.apache.jsp.browse_jsp:170)
>         at org.apache.jsp.browse_jsp._jspService(org.apache.jsp.browse_jsp:100)
>         at org.apache.jasper.runtime.HttpJspBase.service(
>         at javax.servlet.http.HttpServlet.service(
>         at org.apache.jasper.servlet.JspServletWrapper.service(
>         at org.apache.jasper.servlet.JspServlet.serviceJspFile(
>         at org.apache.jasper.servlet.JspServlet.service(
>         at javax.servlet.http.HttpServlet.service(
>         at org.eclipse.jetty.servlet.ServletHolder.handle(
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
>         at org.springframework.web.filter.RequestContextFilter.doFilterInternal(
>         at org.springframework.web.filter.OncePerRequestFilter.doFilter(
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
>         at org.apache.activemq.web.SessionFilter.doFilter(
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
>         at org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
>         at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(
>         at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
>         at org.eclipse.jetty.servlet.ServletHandler.doHandle(
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(
> Thank you.
> Regards,
> Subathra.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message