activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zmhassan (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AMQ-4994) Web Console - java.lang.OutOfMemoryError: Java heap space - while browsing deep queues
Date Thu, 30 Jan 2014 04:24:10 GMT

    [ https://issues.apache.org/jira/browse/AMQ-4994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13886224#comment-13886224
] 

zmhassan edited comment on AMQ-4994 at 1/30/14 4:22 AM:
--------------------------------------------------------

I was originally planning on making a slight change in the design. I was planning on making
a restful endpoint that will display the first hundred JMS messages in queue in JSON format
(one argument 'page'). It would save time and resource because we don't loop through all 200,000
items in queue. However that would make a change in the design and I was thinking there must
be a way that we can reuse existing code that does web service like functionality. 

One option I was looking at was that we could use the RSS/ATOM feed with xml data and pull
from it via javascript on the client-side to get the messages in queue but when I tried this,
it was a really large xml file and takes a long time to load. When the number of messages
grow too large I was unsuccessful in requesting it and parsing it. Perhaps if we can just
display 100 messages of the 200,000 in queue that would make it an easier problem to solve.


http://localhost:8161/admin/queueBrowse/TEST?view=rss&feedType=atom_1.0


Here is an example of how I will get the xml data from JavaScript just in case anyone would
like to see the code:

https://gist.github.com/zmhassan/8702385



was (Author: zmhassan):
I was originally planning on making a slight change in the design. I was planning on making
a restful endpoint that will display the first hundred JMS messages in queue in JSON format
(one argument 'page'). It would save time and resource because we don't loop through all 200,000
items in queue. However that would make a change in the design and I was thinking there must
be a way that we can reuse existing code that does web service like functionality. 

One option I was looking at was that we could use the RSS/ATOM feed with xml data and pull
from it via javascript on the client-side to get the messages in queue but when I tried this,
it was a really large xml file and takes a long time to load. When the number of messages
grow too large I was unsuccessful in requesting it and parsing it. Perhaps if we can just
display 100 messages of the 200,000 in queue that would make it an easier problem to solve.


http://localhost:8161/admin/queueBrowse/TEST?view=rss&feedType=atom_1.0


Here is an example of how I will get the xml data from Javascript just incase anyone would
like to see the code:

https://gist.github.com/zmhassan/8702385


> Web Console - java.lang.OutOfMemoryError: Java heap space - while browsing deep queues
> --------------------------------------------------------------------------------------
>
>                 Key: AMQ-4994
>                 URL: https://issues.apache.org/jira/browse/AMQ-4994
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.9.0
>            Reporter: Dejan Bosanac
>            Priority: Blocker
>         Attachments: AMQ-4994.patch
>
>
> When browsing a deep queue with large number of messages, broker throws 
> {code}java.lang.OutOfMemoryError: Java heap space
> 	at java.util.Arrays.copyOf(Arrays.java:2367)
> 	at java.io.CharArrayWriter.write(CharArrayWriter.java:105)
> 	at java.io.PrintWriter.write(PrintWriter.java:426)
> 	at com.opensymphony.module.sitemesh.filter.RoutablePrintWriter.write(RoutablePrintWriter.java:144)
> 	at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:181)
> 	at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:412)
> 	at org.apache.taglibs.standard.tag.common.core.OutSupport.writeEscapedXml(OutSupport.java:239)
> 	at org.apache.taglibs.standard.tag.common.core.OutSupport.out(OutSupport.java:208)
> 	at org.apache.taglibs.standard.tag.common.core.OutSupport.doStartTag(OutSupport.java:128)
> 	at org.apache.jsp.browse_jsp._jspx_meth_c_out_6(org.apache.jsp.browse_jsp:323)
> 	at org.apache.jsp.browse_jsp.access$8(org.apache.jsp.browse_jsp:314)
> 	at org.apache.jsp.browse_jsp$browse_jspHelper.invoke0(org.apache.jsp.browse_jsp:426)
> 	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(HttpJspBase.java:109)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1320)
> 	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
> 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1291)
> 	at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1291)
> 	at org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:102)
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1291)
> 	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129){code}
> when trying to browse that queue.
> To reproduce it:
> 1. Start a broker with default configuration
> 2. Send 200k messages with
> {code}ant producer -Dmax=200000 -Ddurable=true -Dsubject=TEST{code}
> 3. Try to browse the queue
> http://localhost:8161/admin/browse.jsp?JMSDestination=TEST
> The proper solution to this problem is to implement proper pagination while browsing
the messages, so users can browse through all messages showing 100 msgs (or so) at the time
and not using all the available memory.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message