You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Stefan Schlösser <ss...@intermediate.de> on 2004/02/18 17:08:30 UTC

SqlGeneratorDefaultImpl gobbles up memory ?

Hi,

I have an application which does the same sql (or to be precise 2 sqls) 
over and over again obviously with different data. A memory dump showed 
me that the getPreparedSelectStatement of SqlGeneratorDefaultImpl comes 
out at the top 2 memory consumers of my application !

SqlGeneratorDefaultImpl
java.lang.StringBuffer.<init>(StringBuffer.java:115) 
org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement.getStatement(e) 
 
org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.getPreparedSelectStatement
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(

SITES BEGIN (ordered by live bytes) Wed Feb 18 14:48:14 2004
           percent         live       alloc'ed  stack class
  rank   self  accum    bytes objs   bytes objs trace name
     1  4.07%  4.07%  1878240  910 13234368 6412 53641 [C  //same trace
     2  4.07%  8.14%  1878240  910 13250880 6420 46324 [C  //same trace 
as above as far ojb is concerned

Here is a log excerpt:
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
SQL:SELECT count(A0.mandant),count(A0.ID) FROM SENDER A0 WHERE (A0.ID = 
  ? ) AND A0.mandant =  ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
SQL:SELECT count(A0.mandant),count(A0.ID) FROM Preisliste A0 WHERE 
(A0.ID =  ? ) AND A0.mandant =  ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
SQL:SELECT count(A0.mandant),count(A0.ID) FROM SENDER A0 WHERE (A0.ID = 
  ? ) AND A0.mandant =  ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
SQL:SELECT count(A0.mandant),count(A0.ID) FROM Preisliste A0 WHERE 
(A0.ID =  ? ) AND A0.mandant =  ?
[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
SQL:SELECT count(A0.mandant),count(A0.ID) FROM SENDER A0 WHERE (A0.ID = 
  ? ) AND A0.mandant =  ?

As you can see the statements are fairly simple.

What has gone wrong here ?

Thanks for your help

Stefan Schlösser





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: SqlGeneratorDefaultImpl gobbles up memory ?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi stefan,

what version of ojb do you use ?

jakob

Stefan Schlösser wrote:

> Hi,
> 
> I have an application which does the same sql (or to be precise 2 sqls) 
> over and over again obviously with different data. A memory dump showed 
> me that the getPreparedSelectStatement of SqlGeneratorDefaultImpl comes 
> out at the top 2 memory consumers of my application !
> 
> SqlGeneratorDefaultImpl
> java.lang.StringBuffer.<init>(StringBuffer.java:115) 
> org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement.getStatement(e)
> org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.getPreparedSelectStatement 
> 
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery
> org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(
> 
> SITES BEGIN (ordered by live bytes) Wed Feb 18 14:48:14 2004
>           percent         live       alloc'ed  stack class
>  rank   self  accum    bytes objs   bytes objs trace name
>     1  4.07%  4.07%  1878240  910 13234368 6412 53641 [C  //same trace
>     2  4.07%  8.14%  1878240  910 13250880 6420 46324 [C  //same trace 
> as above as far ojb is concerned
> 
> Here is a log excerpt:
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
> SQL:SELECT count(A0.mandant),count(A0.ID) FROM SENDER A0 WHERE (A0.ID = 
>  ? ) AND A0.mandant =  ?
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
> SQL:SELECT count(A0.mandant),count(A0.ID) FROM Preisliste A0 WHERE 
> (A0.ID =  ? ) AND A0.mandant =  ?
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
> SQL:SELECT count(A0.mandant),count(A0.ID) FROM SENDER A0 WHERE (A0.ID = 
>  ? ) AND A0.mandant =  ?
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
> SQL:SELECT count(A0.mandant),count(A0.ID) FROM Preisliste A0 WHERE 
> (A0.ID =  ? ) AND A0.mandant =  ?
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: 
> SQL:SELECT count(A0.mandant),count(A0.ID) FROM SENDER A0 WHERE (A0.ID = 
>  ? ) AND A0.mandant =  ?
> 
> As you can see the statements are fairly simple.
> 
> What has gone wrong here ?
> 
> Thanks for your help
> 
> Stefan Schlösser
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org