Re: Camel/XMPP 1.6/2.0 - OutOfMemoryError: Java heap space

2009-03-26 Thread orton

Hi Claus/XMPP Component Developers,

Soo... the XMPP consumer runs out of memory also, unfortunately. Was doing a
stand alone consumer test and just found this out. I'm not sure what the
best way to handle it is, but I did try this and it works:

In the xmpp component, XmppConsumer.java, you have to call muc.nextMessage()
also (this is surprising, and I'm not sure why it has to be done on the
consumer side, but it works)

Here's my processPacket()

 public void processPacket(Packet packet) {
Message message = (Message)packet;

if (LOG.isDebugEnabled()) {
LOG.debug("Recieved XMPP message: " + message.getBody());
}

XmppExchange exchange = endpoint.createExchange(message);
try {
getProcessor().process(exchange);
muc.nextMessage();  // <-- line added here. not sure if this
is the best place to call it, but it seems to work here 
} catch (Exception e) {
LOG.error("Error while processing XMPP message", e);
}
}


Is it possible to put this into the 1.6.1 and 2.0 codebase?




Claus Ibsen-2 wrote:
> 
> On Thu, Mar 19, 2009 at 4:20 PM, orton  wrote:
>>
>> Heard from a co-worker:
>>
>> When you send a message to the XMPP server (in this case, OpenFire) it
>> sends
>> a copy back to you and that message has to be dispatched or the queue on
>> the
>> client side will grow and eventually blow up. So it seems that its
>> necessary
>> to call muc.nextMessage().
>>
>> I did a quick mod to the Camel 2.0 XMPP component and added the
>> nextMessage() call to try it out and it does appear to work without
>> throwing
>> the OOM exception.
>>
>> In XmppGroupChatProducer:
>>
>>  public void process(Exchange exchange) {
>>   ...
>>        }
>>        try {
>>            chat.sendMessage(message);
>>            chat.nextMessage();
>>        } catch (XMPPException e) {
>>            throw new RuntimeXmppException(e);
>>        }
>>    }
>>
>>
>> Same thing prolly has to be done for the XmppPrivateChatProducer
>>
>> Is this something you can add into the baseline code James?
> Hi
> 
> Excellent. Can you create a ticket in JIRA, then we have a track
> record of the changes in Camel
> http://camel.apache.org/support.html
> 
>>
>> Thanks!
>>
>>
>> orton wrote:
>>>
>>> Hi James,
>>>
>>> I haven't had a chance to use JProbe yet, but will attempt that later
>>> today
>>>
>>> A few things I noticed were:
>>>
>>> The Smack 3.0.4 client has a history of memory issues and there were
>>> several threads on the Ignite forums regarding the memory issues. I did
>>> some testing on my own on the Smack client and if I simply do continuous
>>> muc.sendMessages, then I run into Out of Memory exceptions. Someone
>>> suggested doing a muc.nextMessage() (which is basically a pull on the
>>> muc
>>> room) after the sendMessage and that actually prevents the OOM error (it
>>> also reduces the efficiency by quite a bit). I'll try with the Smack
>>> 3.1.0
>>> libraries but I believe the issue still persists in the latest version.
>>>
>>> Though not a permanent fix, it might be useful until Ignite fixes all
>>> the
>>> OOM issues with the Smack clients.
>>>
>>> Here are some references to the OOM errors at Ignite:
>>> http://www.igniterealtime.org/community/message/189102
>>>
>>>
>>>
>>>
>>>
>>> James.Strachan wrote:
>>>>
>>>> Running your app using a profiler (either the one in the JDK or JProbe
>>>> or something) would provide useful diagnostics as to what's hogging
>>>> all the RAM - is it the Smack client or something in Camel.
>>>>
>>>> 2009/3/17 orton :
>>>>>
>>>>> Ran some more tests with more memory for the publisher and subscriber,
>>>>> and it
>>>>> still runs out of memory. If I give the the sending and receiving JVM
>>>>> each
>>>>>
>>>>> -Xms256M -Xmx512M -Xmn40M
>>>>>
>>>>> It runs out of memory at around 54000 4KB messages sent and received.
>>>>>
>>>>> Doubling the memory causes it to die around 102000 4KB messages sent
>>>>> and
>>>>> received
>>>>>
>>>>> Any help would be greatly appreciated! Thanks...
>>>>>
>>>>>
>>>>&g

Re: Camel 1.6/2.0 MINA UDP issue

2009-03-26 Thread orton

Hi Claus,

Thanks as always... I did an update on the 1.x branch. The speed is much
faster (3000 4KB messages/sec now) but the client still dies without
throwing the exception, so I am unable to continue...

Thanks!
Orton


Claus Ibsen-2 wrote:
> 
> On Thu, Mar 26, 2009 at 3:10 AM, orton  wrote:
>>
>> Hi Claus,
>>
>> Some of my co-workers have been trying to use the 1.6.1 MINA component
>> and
>> had some of the same issues as we had with 2.0 with regards to the
>> component
>> stopping after some number of consecutive messages. I was wondering
>> (hoping)
>> if the fix would be applied to 1.6.1 also?
>>
>> I just pulled 1.6.1 off the 1.x branch and it didn't appear to have the
>> fix...
> Hi
> 
> Can you try again. I have just committed a fix on the 1.6.1 also. And
> please report back if it works.
> 
>>
>> Thanks!
>>
>> -
>>
>> Hi
>>
>> Just for the good sake. We have identified an issue and fixed it in
>> camel-mina on trunk.
>>
>> Thanks to Orton for providing a sample case that surfaced the issue.
>> Now it works like a charm and doesnt stall using UDP.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22714860.html
>> Sent from the Camel - Development (activemq) mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22722183.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-25 Thread orton

Hi Claus,

Some of my co-workers have been trying to use the 1.6.1 MINA component and
had some of the same issues as we had with 2.0 with regards to the component
stopping after some number of consecutive messages. I was wondering (hoping)
if the fix would be applied to 1.6.1 also? 

I just pulled 1.6.1 off the 1.x branch and it didn't appear to have the
fix...

Thanks!

-

Hi

Just for the good sake. We have identified an issue and fixed it in
camel-mina on trunk.

Thanks to Orton for providing a sample case that surfaced the issue.
Now it works like a charm and doesnt stall using UDP.


-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22714860.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



[jira] Commented: (CAMEL-1467) OutOfMemory Exception in XMPP Component

2009-03-25 Thread Orton Huang (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50805#action_50805
 ] 

Orton Huang commented on CAMEL-1467:


Hi Claus,

Just downloaded the Camel 1.6.1 version... Do you think you can make the same 
XMPP fixes in 1.6.1 that you made in 2.0?


FIX:
For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
chat.nextMessage() after chat.sendMessage()
 public void process(Exchange exchange) {
...
 try {
 chat.sendMessage(message);
 chat.nextMessage(); // <- this line needed!
 } catch (XMPPException e) {
 throw new RuntimeXmppException(e);
 }
   }


Thanks!!
Orton


On 3/20/09 12:52 PM, "Claus Ibsen (JIRA)"  wrote:



[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=50715#action_50715
 ]

Claus Ibsen commented on CAMEL-1467:
----

Orton

There are *no* nextMessage() on the chat object in XmppPrivateChatProducer.
Only the other one got the method.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.




> OutOfMemory Exception in XMPP Component
> ---
>
> Key: CAMEL-1467
> URL: https://issues.apache.org/activemq/browse/CAMEL-1467
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-xmpp
> Environment: Mac OS 10.4.11, Java 1.5, Smack 3.0.4/3.1.0
>Reporter: Orton Huang
>Assignee: Claus Ibsen
> Fix For: 2.0.0, 1.6.1
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> on publishing messages lots of messages using XMPP component (layered on top 
> of Smack 3.0.4/3.1.0 client), Out of Memory Exception occurs. 
> With standard JVM settings, client runs out of memory at around 6600 messages 
> sent. With -Xmx1024M set, client runs out at ~110K messages sent.
> Appears that on a
> chat.sendMessage(message);
> The server sends the message back and the messages needs to be processed on 
> the client side or the client will continue filling its local queue until it 
> runs out of memory
> FIX:
> For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
> chat.nextMessage() after chat.sendMessage()
>  public void process(Exchange exchange) {
>...
> try {
> chat.sendMessage(message);
> chat.nextMessage();
> } catch (XMPPException e) {
> throw new RuntimeXmppException(e);
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CAMEL-1467) OutOfMemory Exception in XMPP Component

2009-03-25 Thread Orton Huang (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50804#action_50804
 ] 

Orton Huang commented on CAMEL-1467:


Hi Claus,

Just downloaded the Camel 1.6.1 version... Do you think you can make the same 
XMPP fixes in 1.6.1 that you made in 2.0?


FIX:
For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
chat.nextMessage() after chat.sendMessage()
 public void process(Exchange exchange) {
...
 try {
 chat.sendMessage(message);
 chat.nextMessage(); // <- this line needed!
 } catch (XMPPException e) {
 throw new RuntimeXmppException(e);
 }
   }


Thanks!!
Orton


On 3/20/09 12:52 PM, "Claus Ibsen (JIRA)"  wrote:



[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=50715#action_50715
 ]

Claus Ibsen commented on CAMEL-1467:
----

Orton

There are *no* nextMessage() on the chat object in XmppPrivateChatProducer.
Only the other one got the method.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.




> OutOfMemory Exception in XMPP Component
> ---
>
> Key: CAMEL-1467
> URL: https://issues.apache.org/activemq/browse/CAMEL-1467
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-xmpp
> Environment: Mac OS 10.4.11, Java 1.5, Smack 3.0.4/3.1.0
>Reporter: Orton Huang
>Assignee: Claus Ibsen
> Fix For: 2.0.0, 1.6.1
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> on publishing messages lots of messages using XMPP component (layered on top 
> of Smack 3.0.4/3.1.0 client), Out of Memory Exception occurs. 
> With standard JVM settings, client runs out of memory at around 6600 messages 
> sent. With -Xmx1024M set, client runs out at ~110K messages sent.
> Appears that on a
> chat.sendMessage(message);
> The server sends the message back and the messages needs to be processed on 
> the client side or the client will continue filling its local queue until it 
> runs out of memory
> FIX:
> For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
> chat.nextMessage() after chat.sendMessage()
>  public void process(Exchange exchange) {
>...
> try {
> chat.sendMessage(message);
> chat.nextMessage();
> } catch (XMPPException e) {
> throw new RuntimeXmppException(e);
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CAMEL-1467) OutOfMemory Exception in XMPP Component

2009-03-20 Thread Orton Huang (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50716#action_50716
 ] 

Orton Huang commented on CAMEL-1467:


Hi Claus,

Ah, sorry little confusion. The nextMessage() needs to be in there to avoid the 
OOM exception...



Orton


On 3/20/09 12:52 PM, "Claus Ibsen (JIRA)"  wrote:



[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=50715#action_50715
 ]

Claus Ibsen commented on CAMEL-1467:
----

Orton

There are *no* nextMessage() on the chat object in XmppPrivateChatProducer.
Only the other one got the method.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.




> OutOfMemory Exception in XMPP Component
> ---
>
> Key: CAMEL-1467
> URL: https://issues.apache.org/activemq/browse/CAMEL-1467
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-xmpp
> Environment: Mac OS 10.4.11, Java 1.5, Smack 3.0.4/3.1.0
>Reporter: Orton Huang
>Assignee: Claus Ibsen
> Fix For: 2.0.0, 1.6.1
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> on publishing messages lots of messages using XMPP component (layered on top 
> of Smack 3.0.4/3.1.0 client), Out of Memory Exception occurs. 
> With standard JVM settings, client runs out of memory at around 6600 messages 
> sent. With -Xmx1024M set, client runs out at ~110K messages sent.
> Appears that on a
> chat.sendMessage(message);
> The server sends the message back and the messages needs to be processed on 
> the client side or the client will continue filling its local queue until it 
> runs out of memory
> FIX:
> For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
> chat.nextMessage() after chat.sendMessage()
>  public void process(Exchange exchange) {
>...
> try {
> chat.sendMessage(message);
> chat.nextMessage();
> } catch (XMPPException e) {
> throw new RuntimeXmppException(e);
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CAMEL-1467) OutOfMemory Exception in XMPP Component

2009-03-20 Thread Orton Huang (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50713#action_50713
 ] 

Orton Huang commented on CAMEL-1467:


Hi Claus,

Good to hear from you again. Hope you're doing well

Sorry bout the confusion.

In XmppPrivateChatProducer, the method that needs to be updated is:

I added the chat.nextMessage() after the chat.sendMessage(message) (line 73) 
below:

Thanks!

--

  public void process(Exchange exchange) {
String threadId = exchange.getExchangeId();

try {
ChatManager chatManager = endpoint.getConnection().getChatManager();
Chat chat = chatManager.getThreadChat(threadId);

if (chat == null) {
chat = chatManager.createChat(getParticipant(), threadId, new 
MessageListener() {
public void processMessage(Chat chat, Message message) {
// not here to do conversation
}
});
}

// TODO it would be nice if we could reuse the message from the 
exchange
Message message = new Message();
message.setTo(participant);
message.setThread(threadId);
message.setType(Message.Type.normal);

endpoint.getBinding().populateXmppMessage(message, exchange);
if (LOG.isDebugEnabled()) {
LOG.debug(">>>> message: " + message.getBody());
}

chat.sendMessage(message);
// receive the return message here - orton
chat.nextMessage();
} catch (XMPPException e) {
throw new RuntimeXmppException(e);
}
}






> OutOfMemory Exception in XMPP Component
> ---
>
> Key: CAMEL-1467
> URL: https://issues.apache.org/activemq/browse/CAMEL-1467
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-xmpp
> Environment: Mac OS 10.4.11, Java 1.5, Smack 3.0.4/3.1.0
>Reporter: Orton Huang
>Assignee: Claus Ibsen
> Fix For: 2.0.0, 1.6.1
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> on publishing messages lots of messages using XMPP component (layered on top 
> of Smack 3.0.4/3.1.0 client), Out of Memory Exception occurs. 
> With standard JVM settings, client runs out of memory at around 6600 messages 
> sent. With -Xmx1024M set, client runs out at ~110K messages sent.
> Appears that on a
> chat.sendMessage(message);
> The server sends the message back and the messages needs to be processed on 
> the client side or the client will continue filling its local queue until it 
> runs out of memory
> FIX:
> For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
> chat.nextMessage() after chat.sendMessage()
>  public void process(Exchange exchange) {
>...
> try {
> chat.sendMessage(message);
> chat.nextMessage();
> } catch (XMPPException e) {
> throw new RuntimeXmppException(e);
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (CAMEL-1467) OutOfMemory Exception in XMPP Component

2009-03-19 Thread Orton Huang (JIRA)
OutOfMemory Exception in XMPP Component
---

 Key: CAMEL-1467
 URL: https://issues.apache.org/activemq/browse/CAMEL-1467
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-xmpp
 Environment: Mac OS 10.4.11, Java 1.5, Smack 3.0.4/3.1.0
Reporter: Orton Huang
 Fix For: 2.0.0


on publishing messages lots of messages using XMPP component (layered on top of 
Smack 3.0.4/3.1.0 client), Out of Memory Exception occurs. 

With standard JVM settings, client runs out of memory at around 6600 messages 
sent. With -Xmx1024M set, client runs out at ~110K messages sent.

Appears that on a

chat.sendMessage(message);

The server sends the message back and the messages needs to be processed on the 
client side or the client will continue filling its local queue until it runs 
out of memory

FIX:

For XmppPrivateChatProducer and XmppGroupChatProducer, need to insert 
chat.nextMessage() after chat.sendMessage()

 public void process(Exchange exchange) {
   ...
try {
chat.sendMessage(message);
chat.nextMessage();
} catch (XMPPException e) {
throw new RuntimeXmppException(e);
}
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Camel/XMPP 1.6/2.0 - OutOfMemoryError: Java heap space

2009-03-19 Thread orton

Heard from a co-worker:

When you send a message to the XMPP server (in this case, OpenFire) it sends
a copy back to you and that message has to be dispatched or the queue on the
client side will grow and eventually blow up. So it seems that its necessary
to call muc.nextMessage(). 

I did a quick mod to the Camel 2.0 XMPP component and added the
nextMessage() call to try it out and it does appear to work without throwing
the OOM exception.

In XmppGroupChatProducer:

  public void process(Exchange exchange) {
   ...
}
try {
chat.sendMessage(message);
chat.nextMessage();
} catch (XMPPException e) {
throw new RuntimeXmppException(e);
}
}


Same thing prolly has to be done for the XmppPrivateChatProducer

Is this something you can add into the baseline code James?

Thanks!


orton wrote:
> 
> Hi James,
> 
> I haven't had a chance to use JProbe yet, but will attempt that later
> today
> 
> A few things I noticed were:
> 
> The Smack 3.0.4 client has a history of memory issues and there were
> several threads on the Ignite forums regarding the memory issues. I did
> some testing on my own on the Smack client and if I simply do continuous
> muc.sendMessages, then I run into Out of Memory exceptions. Someone
> suggested doing a muc.nextMessage() (which is basically a pull on the muc
> room) after the sendMessage and that actually prevents the OOM error (it
> also reduces the efficiency by quite a bit). I'll try with the Smack 3.1.0
> libraries but I believe the issue still persists in the latest version.
> 
> Though not a permanent fix, it might be useful until Ignite fixes all the
> OOM issues with the Smack clients.
> 
> Here are some references to the OOM errors at Ignite:
> http://www.igniterealtime.org/community/message/189102
> 
> 
> 
> 
> 
> James.Strachan wrote:
>> 
>> Running your app using a profiler (either the one in the JDK or JProbe
>> or something) would provide useful diagnostics as to what's hogging
>> all the RAM - is it the Smack client or something in Camel.
>> 
>> 2009/3/17 orton :
>>>
>>> Ran some more tests with more memory for the publisher and subscriber,
>>> and it
>>> still runs out of memory. If I give the the sending and receiving JVM
>>> each
>>>
>>> -Xms256M -Xmx512M -Xmn40M
>>>
>>> It runs out of memory at around 54000 4KB messages sent and received.
>>>
>>> Doubling the memory causes it to die around 102000 4KB messages sent and
>>> received
>>>
>>> Any help would be greatly appreciated! Thanks...
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22562234.html
>>> Sent from the Camel Development mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> James
>> ---
>> http://macstrac.blogspot.com/
>> 
>> Open Source Integration
>> http://fusesource.com/
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22601446.html
Sent from the Camel Development mailing list archive at Nabble.com.



Re: Camel/XMPP 1.6/2.0 - OutOfMemoryError: Java heap space

2009-03-19 Thread orton

Hi James,

I haven't had a chance to use JProbe yet, but will attempt that later today

A few things I noticed were:

The Smack 3.0.4 client has a history of memory issues and there were several
threads on the Ignite forums regarding the memory issues. I did some testing
on my own on the Smack client and if I simply do continuous
muc.sendMessages, then I run into Out of Memory exceptions. Someone
suggested doing a muc.nextMessage() (which is basically a pull on the muc
room) after the sendMessage and that actually prevents the OOM error (it
also reduces the efficiency by quite a bit). I'll try with the Smack 3.1.0
libraries but I believe the issue still persists in the latest version.

Though not a permanent fix, it might be useful until Ignite fixes all the
OOM issues with the Smack clients.

Here are some references to the OOM errors at Ignite:
http://www.igniterealtime.org/community/message/189102





James.Strachan wrote:
> 
> Running your app using a profiler (either the one in the JDK or JProbe
> or something) would provide useful diagnostics as to what's hogging
> all the RAM - is it the Smack client or something in Camel.
> 
> 2009/3/17 orton :
>>
>> Ran some more tests with more memory for the publisher and subscriber,
>> and it
>> still runs out of memory. If I give the the sending and receiving JVM
>> each
>>
>> -Xms256M -Xmx512M -Xmn40M
>>
>> It runs out of memory at around 54000 4KB messages sent and received.
>>
>> Doubling the memory causes it to die around 102000 4KB messages sent and
>> received
>>
>> Any help would be greatly appreciated! Thanks...
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22562234.html
>> Sent from the Camel Development mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> ---
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22601217.html
Sent from the Camel Development mailing list archive at Nabble.com.



Re: Camel/XMPP 1.6/2.0 - OutOfMemoryError: Java heap space

2009-03-17 Thread orton

Ran some more tests with more memory for the publisher and subscriber, and it
still runs out of memory. If I give the the sending and receiving JVM each

-Xms256M -Xmx512M -Xmn40M

It runs out of memory at around 54000 4KB messages sent and received.

Doubling the memory causes it to die around 102000 4KB messages sent and
received

Any help would be greatly appreciated! Thanks...


-- 
View this message in context: 
http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22562234.html
Sent from the Camel Development mailing list archive at Nabble.com.



Re: Camel/XMPP 1.6/2.0 - OutOfMemoryError: Java heap space

2009-03-13 Thread orton



Whats the URI you're using, do you have any camel routes and how much
ram has your JVM?

Hi James,

uri: xmpp://or...@172.18.1.191/?room=t...@conference.nc01&password=orton
I don't have any camel routes set up (just doing a straight up send to the
Openfire Server)

I'm running the java class from Eclipse 3.1.1 and my Eclipse settings are:
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m

I don't run it with any extra VM arguments
-- 
View this message in context: 
http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22496315.html
Sent from the Camel Development mailing list archive at Nabble.com.



Camel/XMPP 1.6/2.0 - OutOfMemoryError: Java heap space

2009-03-12 Thread orton

Hi,

I've been testing the XMPP Camel component and ran into an OutOfMemoryError
after I send about 6600 packets. I have a simple client that just sends
messages one after another and the messages are roughly 4KB in size. 

My client code is pretty simple:

-
public void sendMessages(int numOfMessages, int messageSize, String fileStr)
throws Exception {

CamelContext context = new DefaultCamelContext();
context.start();

Endpoint endpoint = context.getEndpoint(uri);
Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);

Producer producer = endpoint.createProducer();
producer.start();

for (int i = 0; i < numOfMessages; i++) {
String s = fileStr;
exchange.getIn().setBody(s);
producer.process(exchange);

if ( (i+1) % 100 == 0 ) {
System.out.println("Messages Sent: " + i);
}

Thread.sleep(5);
}
producer.stop();
context.stop();
}

And the error I get is:

-
Messages Sent: 6499
Messages Sent: 6599
Exception in thread "Smack Packet Writer (0)" java.lang.OutOfMemoryError:
Java heap space
at
java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
at 
java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:518)
at java.lang.StringBuilder.append(StringBuilder.java:190)
at
org.jivesoftware.smack.util.StringUtils.escapeForXML(StringUtils.java:301)
at org.jivesoftware.smack.packet.Message.toXML(Message.java:314)
at 
org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:258)
at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:40)
at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:87)
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.lang.String.(String.java:208)
at java.lang.StringBuilder.toString(StringBuilder.java:431)
at
org.apache.camel.component.xmpp.XmppGroupChatProducer.process(XmppGroupChatProducer.java:56)
at
edu.mit.ll.test.clients.XMPPCamelTestPublisher.sendMessages(XMPPCamelTestPublisher.java:132)
at
edu.mit.ll.test.clients.XMPPCamelTestPublisher.main(XMPPCamelTestPublisher.java:169)


I've tried it with the 1.6 release and the latest 2.0 SNAPSHOT. The smack
and smackx components I use are 3.0.4. I'm also running an Openfire server
on a remote machine.

Has anyone seen this or might be able to help?

Much thanks,
Orton
-- 
View this message in context: 
http://www.nabble.com/Camel-XMPP-1.6-2.0---OutOfMemoryError%3A-Java-heap-space-tp22485629p22485629.html
Sent from the Camel Development mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-12 Thread orton

Hi Again,

Thanks Claus for the fix! That resolved the issue I was having with the MINA
sender and I can run it a lot longer.

Unfortunately :( however, I get this problem now after many more messages:

Messages Sent: [Publisher]: Test Body Message: 2366999
Messages Sent: [Publisher]: Test Body Message: 2367999
Messages Sent: [Publisher]: Test Body Message: 2368999
Exception caught: Cannot write body on the exchange: Exchange[Message:
[Publisher]: Test Body Message: 2369836]
org.apache.camel.CamelExchangeException: Cannot write body on the exchange:
Exchange[Message: [Publisher]: Test Body Message: 2369836]
at 
org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:52)
at
org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
at
edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
at edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:133)

In this case, I'm sending 30 Byte messages one after another as fast as I
can and it gets to 2.3 million messages or so. I'm not sure if I'm running
out of memory (perhaps the garbage collection is cleaning up things fast
enough)?

Thoughts? Thanks again!

Claus Ibsen-2 wrote:
> 
> Hi
> 
> Just for the good sake. We have identified an issue and fixed it in
> camel-mina on trunk.
> 
> Thanks to Orton for providing a sample case that surfaced the issue.
> Now it works like a charm and doesnt stall using UDP.
> 
> 
> On Wed, Mar 11, 2009 at 10:05 AM, Claus Ibsen 
> wrote:
>> Hi
>>
>> Can you create a zip with a sample project that demonstrates this issue?
>> I would like to take a look.
>>
>> Its interresting that creating a new producer once in a while resolves
>> it. eg you get a brand new MINA session to work with.
>>
>>
>> On Tue, Mar 10, 2009 at 8:01 PM, orton  wrote:
>>>
>>> One more thing...
>>>
>>> Right now, I'm just catching all Exceptions and printing them out. When
>>> the
>>> component stops sending, usually no exceptions are thrown... Not sure if
>>> they are getting swallowed up somewhere lower.
>>>
>>> However, one time I ran it, for some reason I did get this:
>>>
>>> Exception caught: Could not write body on the exchange:
>>> Exchange[Message:
>>> [Publisher]: Test Body Message: 34535]
>>> org.apache.camel.CamelExchangeException: Could not write body on the
>>> exchange: Exchange[Message: [Publisher]: Test Body Message: 34535]
>>>                                         at
>>> org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:47)
>>>                                         at
>>> org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
>>>                                         at
>>> edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
>>>                                         at
>>> edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:84)
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22441278.html
>>> Sent from the Camel - Development (activemq) mailing list archive at
>>> Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22479515.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton

One more thing... 

Right now, I'm just catching all Exceptions and printing them out. When the
component stops sending, usually no exceptions are thrown... Not sure if
they are getting swallowed up somewhere lower.

However, one time I ran it, for some reason I did get this:

Exception caught: Could not write body on the exchange: Exchange[Message:
[Publisher]: Test Body Message: 34535]
org.apache.camel.CamelExchangeException: Could not write body on the
exchange: Exchange[Message: [Publisher]: Test Body Message: 34535]
 at
org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:47)
 at
org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
 at
edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
 at
edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:84)
-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22441278.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton


>It marshal the entire Exchange, eg the container object in Camel used
>when routing messages.
>Its an option to use MINA as a kind of bridge between camel instances.
>So you can keep headers, properties etc. when you send the Exchange
>using Mina.
>Normally you only send the payload itself, eg the Body.

>So when the Exchange is assembled on the other side it could contain
>stuff mina there could get confused over. But I really doubt it.

>I put my rely on the fix.

>But could you test with transferExchange=true and again with it =false

Hi Claus,

So I retrieved the latest Camel 2.0 MINA code and re-compiled.
Unfortunately, I still see the same problem for UDP :(

The transferExchange appears only relevant to TCP? When I set it to "true"
for UDP, it throws an IllegalArgumentException (not supported for Datagram
Protocol). Setting it to "false" does not appear to change anything (still
failing)

Having the UDP server endpoint on a different machine entirely also did not
affect anything...

I'm not sure if this may help you debug, but if I reset the producer:
 producer = endpoint.createProducer();
 producer.start();
every thousand or so sends, then i can keep sending (tested it up to a
million packets and it doesn't stop)







-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22439406.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton


≥Oh if you do NOT use the transferExchange=true option. eg if you send
≥regular payload with Camel 1.6.0.

≥But yet again would be nice if you try the comitted fix.

Hi Claus, am updating my Camel 2.0 code from repository and compiling now.

Can you explain the transferExchange comment some more? Sorry, still a
little new to Camel and not sure how that option affects things?

Thanks again!!

-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22434468.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton

> What version of Camel and Mina are you using?

I tried it out on the Camel 1.6 bin release and I compiled the Camel 2.0
snapshot in svn and both appeared to have the same problem... mina-core for
both appear to be 1.1.7

> Mina is in the works of doing a Mina 2.0 that might be much better.
> When its release we will upgrade it in Camel 2.0 as well.

> Yes the memory leaks is interresting? Where did you find them?

I only saw some references in past forums and some of my co-workers have
mentioned them to me also, will look for more details and send to you

> And whats the relevanse of you test? Sending 65.000 udp packages to
> yourself?
> Are you using Camel to be the Mina server as well? Or do you send it
> to another JVM?

We're trying to do some simple stress and overhead testing on the Camel
components... We really like what you guys have done with it and find the
patterns extremely useful. We want to see how suitable it is for
applications with high throughput, low latency needs and what the extra cost
for using Camel is. I have separate servers in different VM's but on the
same host for now. 


> Using TCP that works. Are you using the exact same sample but just
> change udp to tcp in the endpoint URI?

I send the exact same samples with UDP and TCP... Just tried the multicast
one and it gives me the same issue as the UDP one...


-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22434032.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Camel 1.6/2.0 MINA UDP issue

2009-03-09 Thread orton

Hi,

I've been trying to use the MINA component for UDP data delivery but have
been having some issues and was wondering if anyone else has seen this
error.

I'm sending small packets (<100Bytes) as fast as I can (sequentially from a
single client) but after around 35,000 packets sent, the Camel client
abruptly stops without any errors/exceptions. I first tried this with the
1.6 release and saw this problem and recently downloaded and compiled the
2.0 core and components but still have the same issue. When I use MINA with
TCP, I don't have this problem...

Here's what I have for code:
-

public void init( String serverIP, int serverPort ) {
uri = "mina:udp://" + serverIP + ":" + serverPort + 
"?sync=false";
System.out.println("Camel URI: " + uri);
}

public void sendMessages(int numOfMessages, int messageSize) throws
Exception {

CamelContext context = new DefaultCamelContext();
context.start();

Endpoint endpoint = context.getEndpoint(uri);
Exchange exchange =
endpoint.createExchange(ExchangePattern.InOnly);
Producer producer = endpoint.createProducer();
producer.start();

for (int i = 0; i < numOfMessages; i++) {
String s = "[Publisher]: Test Body Message: " + i;
exchange.getIn().setBody(s);
producer.process(exchange);
}
producer.stop();
}


I looked through various forums and saw some memory leak issues, but wasn't
sure if this is related?

If anyone can help, would be much appreciated!!

Orton
-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22426433.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.