[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
Simon- you're absolutely right. It's clear from looking at the code that it's highly inefficient to allocate a large buffer when perhaps as little as one byte is read from the stream. I have refactored the code, so this is done more sensibly! The fix will be in the next release (on Monday) View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250994#4250994 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250994 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
The loop in ClientProducerImpl seems to be responsible: while (!lastChunk) | { | byte[] bytesRead = new byte[minLargeMessageSize]; | int numberOfBytesRead; | | try | { |numberOfBytesRead = input.read(bytesRead); | } | catch (IOException e) | { |throw new MessagingException(MessagingException.LARGE_MESSAGE_ERROR_BODY, | Error reading the LargeMessageBody, | e); | } | | if (numberOfBytesRead 0) | { |numberOfBytesRead = 0; |lastChunk = true; | } | | final SessionSendContinuationMessage chunk = new SessionSendContinuationMessage(bytesRead, | numberOfBytesRead, | !lastChunk, | lastChunk sendBlocking); | | if (sendBlocking lastChunk) | { |// When sending it blocking, only the last chunk will be blocking. |channel.sendBlocking(chunk); | } | else | { |channel.send(chunk); | } | } | By configuring my connection factory I have minLargeMessageSize=131072 (128K) My input stream is a buffered input stream returning 1024 bytes at a time. The stream source is 512K in length. Therefore, each time around the loop I will create a new 128K byte[] with 1K of data read into it. I then pass a reference to the array to new SessionSendContinuationMessage. With 512 loop interations required to read and send the stream content I consume 64M of heap space in byte arrays. wdyt? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250830#4250830 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250830 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
What is your windowSize? I will make a few tests. With LargeMessage, you should have a bunch of pending packets waiting to be delivered on the NettyQueue, but you shouldn't have more than what's configured on the windowSize. Otherwise you would get out of memory easily. I would need to look at your test to know what' s happening better. Perhaps you're opening multiple producers? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250902#4250902 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250902 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
From my jbm-jms.xml connection-factory name=SocketConnectionFactory | connector-ref connector-name=netty/ | entries | entry name=ConnectionFactory/ | entry name=XAConnectionFactory/ | /entries | !-- 128K chunk size for large messages -- | min-large-message-size131072/min-large-message-size | !-- Set the consumer window size to 512K to limit the size of the buffer on the client side -- | consumer-window-size524288/consumer-window-size |/connection-factory | I'm creating a bytes message, adding my buffered stream to it: bytesMessage.setObjectProperty( JMS_JBM_InputStream, pin ); then calling: producer.send( bytesMessage, deliveryMode, priority, timeToLive ); Many Thanks View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250907#4250907 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250907 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
A single producer? Or you're opening several Producers? How many threads doing this.. just one? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250909#4250909 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250909 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
Yes a single producer on one thread from a junit test case. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250912#4250912 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250912 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
Can you send me a sample test showing this happening? clebert at redhat dot com or clebert dot suconic at jboss dot com View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250915#4250915 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250915 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging] - Re: JBM2 Beta5 with JBAS5.1 - Memory leak SessionContinuatio
Did you make any changes on the windowSize? You should have up to your WindowSize messages in memory. (We control that thorugh flow control). [url] http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/docs/usermanual-2.0.0.beta4/html/flow-control.html#flow-control.core.api[/url] If you disable flow-control.. you will have messages piling up on the memory. if that's not the case, I would need to take a look at your test. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4250717#4250717 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250717 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user