Friday, March 30, 2012

OutOffMemory Exception

Hi all,
I have an exception as follows:
java.lang.OutOfMemoryError
at com.microsoft.util.UtilPagedTempBuffer.compressBlo ckList(Unknown Source)
at com.microsoft.util.UtilPagedTempBuffer.getBlock(Un known Source)
at com.microsoft.util.UtilPagedTempBuffer.write(Unkno wn Source)
at com.microsoft.util.UtilPagedTempBuffer.write(Unkno wn Source)
at com.microsoft.util.UtilByteArrayDataProvider.recei ve(Unknown Source)
at com.microsoft.util.UtilByteOrderedDataReader.recei ve(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.sub mitRequest(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest. openCursor(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.execute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQuery Internal(Unknown
Source)
at com.microsoft.jdbc.base.BasePreparedStatement.exec uteQuery(Unknown
Source)
De query used is a simple select statement:
select t1.pm_key, t2.type
from table1 t1, table2 t2
where t1.pm_key = t2.pm_key
and t2.status <= '160-00'
and t1.from_key = 'P000003456'
My questions:
1. Is it a driver problem?
2. What is the driver doing at that point?
3. How can I avoid this ? (i.e. re-write the query)
4. Can I give the process more memory (other than -Xmx<amount>)?
Any tips/hints are very welcome.
TIA.
Frank.
Hi.
How much data is being returned?
I would suggest adding the connection property
selectMethod=cursor to your connection properties.
That might save client-side memory.
Joe Weinstein at BEA
Frank Brouwer wrote:

> Hi all,
> I have an exception as follows:
> java.lang.OutOfMemoryError
> at com.microsoft.util.UtilPagedTempBuffer.compressBlo ckList(Unknown Source)
> at com.microsoft.util.UtilPagedTempBuffer.getBlock(Un known Source)
> at com.microsoft.util.UtilPagedTempBuffer.write(Unkno wn Source)
> at com.microsoft.util.UtilPagedTempBuffer.write(Unkno wn Source)
> at com.microsoft.util.UtilByteArrayDataProvider.recei ve(Unknown Source)
> at com.microsoft.util.UtilByteOrderedDataReader.recei ve(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.sub mitRequest(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest. openCursor(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.execute(Unknown
> Source)
> at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.executeQuery Internal(Unknown
> Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.exec uteQuery(Unknown
> Source)
> De query used is a simple select statement:
> select t1.pm_key, t2.type
> from table1 t1, table2 t2
> where t1.pm_key = t2.pm_key
> and t2.status <= '160-00'
> and t1.from_key = 'P000003456'
> My questions:
> 1. Is it a driver problem?
> 2. What is the driver doing at that point?
> 3. How can I avoid this ? (i.e. re-write the query)
> 4. Can I give the process more memory (other than -Xmx<amount>)?
>
> Any tips/hints are very welcome.
> TIA.
> Frank.
>
|||Hi Joe,
Thanks for the tip, but I already use that selection method on the
connection. The query is supposed to retrieve about 1,500 reccords and the
tables contain about 30,000 reccords. It also takes a long time of usage
of the system before the message appears so I also checked for memory leaks
(closing connections and prepared statements etc..).
If I look at the log file I have, there is an other message just before the
OutOffMemory message:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]Transaction (Process ID 69) was deadlocked on {lock}
resources with another process and has been chosen as the deadlock victim.
Rerun the transaction.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.pro cessReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest. openCursor(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.execute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQuery Internal(Unknown
Source)
at com.microsoft.jdbc.base.BasePreparedStatement.exec uteQuery(Unknown
Source)
Do you think that it can cause this problem?
If I look at:
at com.microsoft.util.UtilPagedTempBuffer.compressBlo ckList(Unknown Source)
I think that the JDBC driver is using some kind of internal (Hash?) table to
do some sorting, is it possible that this has some kind of limmit?
Thanks for your help.
Frank.
"Joe Weinstein" <joeNOSPAM@.bea.com> wrote in message
news:408FDABC.5060508@.bea.com...[vbcol=seagreen]
> Hi.
> How much data is being returned?
> I would suggest adding the connection property
> selectMethod=cursor to your connection properties.
> That might save client-side memory.
> Joe Weinstein at BEA
> Frank Brouwer wrote:
Source)
>
|||Frank Brouwer wrote:

> Hi Joe,
> Thanks for the tip, but I already use that selection method on the
> connection. The query is supposed to retrieve about 1,500 reccords and the
> tables contain about 30,000 reccords. It also takes a long time of usage
> of the system before the message appears so I also checked for memory leaks
> (closing connections and prepared statements etc..).
> If I look at the log file I have, there is an other message just before the
> OutOffMemory message:
> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
> JDBC][SQLServer]Transaction (Process ID 69) was deadlocked on {lock}
> resources with another process and has been chosen as the deadlock victim.
> Rerun the transaction.
> at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown Source)
> at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReplyToken(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.pro cessReplyToken(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReply(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest. openCursor(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.execute(Unknown
> Source)
> at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.executeQuery Internal(Unknown
> Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.exec uteQuery(Unknown
> Source)
> Do you think that it can cause this problem?
>
no.

> If I look at:
> at com.microsoft.util.UtilPagedTempBuffer.compressBlo ckList(Unknown Source)
> I think that the JDBC driver is using some kind of internal (Hash?) table to
> do some sorting, is it possible that this has some kind of limmit?
No limit as such, but maybe inefficient code for the size of the task.
If you can make a standalone simple jdbc program that creates
the table, loops populating it, and then does the call that causes the mem
problem, MS would take it from there...
Joe

> Thanks for your help.
> Frank.
> "Joe Weinstein" <joeNOSPAM@.bea.com> wrote in message
> news:408FDABC.5060508@.bea.com...
>
> Source)
>
>

No comments:

Post a Comment