bhq / asmack

Automatically exported from code.google.com/p/asmack
Other
0 stars 0 forks source link

There is a memory leak when big amout of data is sent through xmpp #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What are you doing to produce the error?
1. Open the connection
XMPPConnection xmpp = new XMPPConnection("gmail.com");
xmpp.connect();
xmpp.login("user", "password");

2. Join to a room and listen for data
multChat = new MultiUserChat(xmpp, roomName);
multChat.join("user");
multChat.addMessageListener(.....);

3. Send big amount of data through the xmpp connection.

What is the expected output?
The data should have been processed correctly.

What do you see instead? (Please attach a debug enabled logcat)
There is a continuous memory increasing. Using the DDMS Heap we can see how the 
memory increase with each new xmpp packet received.

What version of aSmack / Android / Device do you use?
I have tried these ones:
asmack-jse-buddycloud-2010.12.11.jar
asmack-2010.05.07.jar

What server do you use? Is there a public server to reproduce the problem?
I use the gtalk server.

What else might help us to reproduce and hunt down the problem?

This is the erro ir get:

03-03 10:22:29.847: ERROR/dalvikvm-heap(19688): Out of memory on a 2928-byte 
allocation.
03-03 10:22:29.867: ERROR/dalvikvm(19688): Out of memory: Heap Size=16143KB, 
Allocated=14769KB, Bitmap Size=0KB, Limit=13756KB
03-03 10:22:29.867: ERROR/dalvikvm(19688): Extra info: Footprint=16327KB, 
Allowed Footprint=16391KB, Trimmed=248KB
03-03 10:22:29.877: WARN/dalvikvm(19688): threadid=11: thread exiting with 
uncaught exception (group=0x40028a00)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688): FATAL EXCEPTION: Smack Packet 
Reader (0)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688): java.lang.OutOfMemoryError
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
java.lang.StringBuilder.append(StringBuilder.java:217)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
org.jivesoftware.smack.util.PacketParserUtils.parseContent(PacketParserUtils.jav
a:166)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
org.jivesoftware.smack.util.PacketParserUtils.parseMessage(PacketParserUtils.jav
a:110)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:227)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
03-03 10:22:29.877: ERROR/AndroidRuntime(19688):     at 
org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:71)
03-03 10:22:29.897: WARN/ActivityManager(97):   Force finishing activity 
org.mcardio/.CMainEcg

Regards,

Santiago.

Original issue reported on code.google.com by santi....@gmail.com on 3 Mar 2011 at 12:35

Attachments:

GoogleCodeExporter commented 9 years ago
  do you flush?

Original comment by zengqin...@gmail.com on 31 Mar 2011 at 7:09