Re: OutOfMemoryError with Proxy
Armin Waibel <[email protected]>
| Newsgroups | gmane.comp.jakarta.ojb.user |
|---|---|
| Message-ID | <[email protected]> |
mananthakris wrote: > Thanks for the quick response.We are using OJB1.0rc4. ops! This is really outdated. > yes we can use > getObjectByIdentity. But the stack trace of the error shows that > getObjectByQuery is internally calling getObjectByIdentity,so did not think > this would help. yep, agree with you. If PB.getObjectByIdentity is used it's possible that OJB find the object in the cache without executing a DB query. > How can we find how many objects are materialized at a > given time? That's not easy. OJB hasn't methods to trace count of materialized objects. You could try to log sql statements. I think if OJB would materialize millions of objects you would get memory errors with less user too (but as you said the problem only occurs under heavy load). > Here since it is byPrimarykey i am assuming at this point of time it is > trying to materialize only one object or its all related objects too. > > Also what does that the stack trace mean by saying that getObjectByIdentity > calls getReferencedObject and persistenceBrokerImpl.retrieveCollections > (does it try to get all related objects if an object is requested?) On materialization of an object OJB always loops over all ReferenceDescriptor of an object and checks if the reference have to be materialized too or if a proxy object have be used or if nothing have to be done. Thats why you see persistenceBrokerImpl.retrieveCollections... methods calls in the stack trace. > > Attached is the OJB.properties file and our repository file > In the attachment repository_database.xml is missing. regards, Armin > > Armin Waibel wrote: >> Hi, >> >> could you post the OJB.properties and jdbc-connection-descriptor too? >> This would help to find problematic settings. >> Which version of OJB do you use? >> >> mananthakris wrote: >>> Hi, >>> We are using OJB with Jboss,Mysql on linux. >>> We have implemented all we could as suggested by OJB performance >>> tutorial. >>> We are using Proxies,default cache,PB-api,odmg transaction,but we can't >>> use >>> getIteratorByQuery because the results are processed after the >>> transaction >>> is closed. We are facing outofmemory error in two places always. One >>> while >>> materializing subject from proxy and two using getObjectByQuery for >>> finding >>> an object by primarykey. >> Isn't it possible to lookup the object by Identity instead of using a >> query? >> http://db.apache.org/ojb/docu/tutorials/pb-tutorial.html#Find+object+by+primary+key >> >> >>> It happens only if a lot of users around 200 are >>> using the system. >> How many objects are materialized? >> >> regards, >> Armin >> >>> We have two tier systems with jboss running on a linux >>> machine with 4GB ram and we have also finetuned jvm options that has >>> reduced >>> frequency of OutOfMemoryError (we use -Xms768M -Xmx768M -XX:NewSize=256M) >>> Any suggestions are appreciated? Should we be looking at mysql >>> performance,any good tools for profiling ojb? >>> Here is the stack trace of two errors >>> 1)java.lang.OutOfMemoryError >>> rethrown as >>> org.apache.ojb.broker.PersistenceBrokerException >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveCollection(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveCollections(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getExtentDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getReferencedObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReference(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReferences(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.accesslayer.IndirectionHandler.materializeSubject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Unknown >>> Source) >>> at org.apache.ojb.broker.VirtualProxy.getRealSubject(Unknown >>> Source) >>> at >>> com.tk20.bo.BaseServerObjectProxy.realSubject(BaseServerObjectProxy.java:46) >>> at >>> com.tk20.bo.BaseServerObjectProxy.getRelatedObjects(BaseServerObjectProxy.java:334) >>> at >>> com.tk20.ejb.api.query.QueryMgrEJB.getList(QueryMgrEJB.java:83) >>> >>> 2)java.lang.OutOfMemoryError >>> rethrown as >>> org.apache.ojb.broker.PersistenceBrokerException >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveCollection(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveCollections(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getExtentDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getReferencedObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReference(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReferences(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getExtentDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getReferencedObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReference(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReferences(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getExtentDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getReferencedObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReference(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReferences(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown >>> Source) >>> at >>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown >>> Source) >>> at >>> com.tk20.ejb.api.BaseServiceEJB.findByPrimaryKey(BaseServiceEJB.java:189) >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >> > http://www.nabble.com/file/4504/OJB.properties OJB.properties > http://www.nabble.com/file/4505/repository.xml repository.xml > http://www.nabble.com/file/4506/repository_user.xml repository_user.xml > http://www.nabble.com/file/4507/repository_internal.xml > repository_internal.xml