Hi,

We have been analysing our application's performance with OptimizeIt and we
think we might have come across a memory leak within the JConnect 5.2
driver.

Our platform is WinNT 4.0 SP6, JConnect 5.2 (with Cover.Roll June 6, 2001
7888-9648 if that's any help) and we are using javax.sql.ConnectionPool
(probably significant).

We are finding that there is a steadily increasing number of
com.sybase.jdbc2.utils.BufferInterval instances.

This doesn't format well in straight text (if anyone wants the html output
from OptimizeIt just email robert.j.greig@jpmorgan.com and I'll provide
it).

Here it is anyway:
Backtrace of code allocating com.sybase.jdbc2.utils.BufferInterval
201 instances of com.sybase.jdbc2.utils.BufferInterval allocated.
98.5% com.jpmorgan.researchcontent.transmit.core.ManagedThread.run()
(starting in ManagedThread.java:39)
98.5%
com.jpmorgan.researchcontent.transmit.core.ThreadPoolManager.threadWaiting()
(starting in ThreadPoolManager.java:79)
98.5%
com.jpmorgan.researchcontent.transmit.core.ManagedThread.startRunnable()
(starting in ManagedThread.java:61)
98.5%
com.jpmorgan.researchcontent.transmit.core.Controller.execute() (starting
in Controller.java:79)
59.2%
com.jpmorgan.researchcontent.transmit.service.source.ipub.IpubResearch.execute()
(starting in IpubResearch.java:133)
58.2%
com.jpmorgan.researchcontent.transmit.database.DatabaseUtility.close()
(starting in DatabaseUtility.java:238)
58.2%
com.sybase.jdbc2.jdbc.SybConnectionProxy.close() (starting in
SybConnectionProxy.java:109)
58.2%
com.sybase.jdbc2.jdbc.SybPooledConnection.notifyListeners() (starting in
SybPooledConnection.java:186)
58.2%
com.jpmorgan.researchcontent.transmit.database.ConnectionPool.connectionClosed()
(starting in ConnectionPool.java:148)
58.2%
com.sybase.jdbc2.jdbc.SybConnectionProxy.isClosed() (starting in
SybConnectionProxy.java:397)
58.2%
com.sybase.jdbc2.jdbc.SybConnection.isClosed() (starting in
SybConnection.java:732)
50.24%
com.sybase.jdbc2.jdbc.SybStatement.close() (starting in
SybStatement.java:417)
50.24%
com.sybase.jdbc2.jdbc.SybStatement.doCancel() (starting in
SybStatement.java:553)
50.24%
com.sybase.jdbc2.tds.Tds.cancel() (starting in Tds.java:1231)
50.24%
com.sybase.jdbc2.tds.Tds.cancel() (starting in Tds.java:1244)
50.24%
com.sybase.jdbc2.tds.Tds.getCancel() (starting in Tds.java:1370)
50.24%
com.sybase.jdbc2.tds.Tds.nextResult() (starting in Tds.java:1683)
50.24% com.sybase.jdbc2.tds.TdsInputStream.readUnsignedByte() (starting in
TdsInputStream.java:114)
50.24% com.sybase.jdbc2.tds.TdsInputStream.read() (starting in
TdsInputStream.java:81)
50.24% com.sybase.jdbc2.tds.PduInputFormatter.read() (starting in
PduInputFormatter.java:60)
50.24% com.sybase.jdbc2.tds.PduInputFormatter.readPacket()
(starting in PduInputFormatter.java:224)
50.24% com.sybase.jdbc2.tds.TdsProtocolContext.getChunk()
(starting in TdsProtocolContext.java:511)
50.24% com.sybase.jdbc2.timedio.InStreamMgr.doRead()
(starting in InStreamMgr.java:265)
50.24%
com.sybase.jdbc2.timedio.InStreamMgr.readIfOwner() (starting in
InStreamMgr.java:503)
50.24% com.sybase.jdbc2.timedio.Dbio.doRead()
(starting in Dbio.java:224)
49.75%
com.sybase.jdbc2.timedio.InStreamMgr.moreData() (starting in
InStreamMgr.java:321)
49.75%
com.sybase.jdbc2.tds.TdsProtocolContext.queueData() (starting in
TdsProtocolContext.java:194)
49.75%
com.sybase.jdbc2.timedio.StreamContext.makeChunk() (starting in
StreamContext.java:118)
49.75%
com.sybase.jdbc2.utils.BufferInterval.divide() (starting in
BufferInterval.java:59)
0.49%
com.sybase.jdbc2.timedio.InStreamMgr.setBuffer() (starting in
InStreamMgr.java:420)
0.49%
com.sybase.jdbc2.utils.BufferPool.getBI() (starting in BufferPool.java:200)
0.49%
com.sybase.jdbc2.utils.BufferPool.makeBuffer() (starting in
BufferPool.java:219)


I'm betting that these BufferInterval classes would be cleaned up when the
connection is closed, but in a connection pool it isn't closed obviously.
Calling con.isClosed() is causing most of them to be created (judging from
the output of OptimizeIt).

If any more info is required, just ask.

Regards,

Robert Greig