powered by Jive Software

connectionClosedOnError() and piles of threads problem need your help!

hi,

I got some problems with smack.

1.) the connection always report the following error(I used log4j to catch it). What does it mean?

MyConnectionListener:46 - connectionClosedOnError() no more data available - expected end tag </stream:stream> to close start tag stream:stream from line 1, parser stopped on END_TAG seen … … @1:879

MyConnectionListener:46 - connectionClosedOnError() called by 1018452, AQ Server Connection Closed on Error::no more data available - expected end tag </stream:stream> to close start tag stream:stream from line 1, parser stopped on END_TAG seen … … @1:1098

2.) I wonder how it remove smack threads named “Smack Packet Reader”, “Smack Listener Processor”, “Smack Packet Writer”,“Smack Keep Alive”? In fact, I use smack to write servlet, but after a period of time, lots of threads were left with prefix smack and then the memory went out of memory at last. pls help me to resovle the problem.

thanks!

Hi, you need to close the connection once you’'re done with it, that should cause the threads to eventually finish.

Once you’'ve found out how to do that, you might be interested in checking two patches I just posted. These patches free the allocated threads immediately once the connection is closed and are supposed to make Smack behave a bit better in environments with a lot of XMPPConnections.

Note that these patches haven’'t been reviewed by the developers yet, but I posted them for everybody to test and use until the Smack team has the time to check them.

http://www.jivesoftware.org/forums/thread.jspa?threadID=13730&tstart=0

http://www.jivesoftware.org/forums/thread.jspa?threadID=13731&tstart=0

Just out of curiosity, does the machine you’'re testing on happen to have multiple CPUs or an HyperThreading CPU?