[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[xmlblaster] memory leak?
Hi,
I found the following question:
The publisher send volatile messages( 1K size each) and the subscriber received it. When the publisher send about 30000 message, it got the OutOfMemory Exception.
I used the OptimizeIt Profiler to debug the server. finding that every time a message is published, A MessageUnitHandler and SubscribeInfo instance produced and they would never GCed even if the client loged out.
my publish code
//======================================================================
String xmlKey = null;
PublishQosWrapper qw = new PublishQosWrapper();
qw.isVolatile(true);
System.out.println("qos = " + qw.toXml() );
byte[] b = new byte[1024];
while(true){
synchronized(this){
if ( _bQuit ) break;
}
lCount++;
xmlKey = "<key oid='" + lCount +
"'> <topic id='aaaa'/>" +
"</key>";
_conn.publish(new MessageUnit(xmlKey,b,qw.toXml()));
// System.out.println(new Timestamp(System.currentTimeMillis())+":"+lCount);
Thread.currentThread().sleep(1);
}
regards,
liuwen.