Hi Ilkka,
shutdown() does not appear to be a method of
PersistenceBrokerFactoryFactory.instance(). Is there a patch with this
available?
Ilkka Priha wrote:
Hi Rick,
Have you tried this one, it alone should do the job.
PersistenceBrokerFactoryFactory.instance().shutdown();
-- Ilkka
Rick Roman wrote:
Update: From other threads, I have tried using a contextDestroy
listener to run:
PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
broker.clearCache();
broker.close(); PersistenceBrokerFactory.releaseAllInstances();
ConnectionFactoryFactory.getInstance().createConnectionFactory().releaseAllResources();
PersistenceBrokerThreadMapping.shutdown();
MetadataManager.getInstance().removeAllProfiles();
and the leak still persists.
Rick Roman wrote:
I am using OBJ to access PostgreSQL via a JNDI datasource. My
problem is that every time I reload my application context, I get a
big jump in Tomcat Perm Gen memory. After a several reloads, tomcat
eventually crashes with an out of memory error. I believe this has
to do with my OBJ configuration as I am able to access the
datasource without OBJ and I don't see the problem. The memory leak
problem is a known issue, discussed in detail here:
http://opensource2.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669
In short, the problem is that "if any object that is loaded by the
system or container classloader (StandardClassLoader in tomcat)
still has a reference to the application class loader or any object
loaded by it, the class loader will not be garbage collected. In
that case, all the class objects and every object referenced by a
static field in any of the classes will not be garbage collected."
Does anyone know how I can get rid of this behavior?
(repository.xml, OBJ.properties below)
repository.xml
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="PostgreSQL"
jdbc-level="3.0"
jndi-datasource-name="java:comp/env/jdbc/mff/mffweb"
eager-release="false"
batch-mode="false"
useAutoCommit="1"
ignoreAutoCommitExceptions="false" > <object-cache
class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
<attribute attribute-name="cacheExcludes" attribute-value=""/>
<attribute attribute-name="timeout" attribute-value="900"/>
<attribute attribute-name="autoSync" attribute-value="true"/>
<attribute attribute-name="cachingKeyType" attribute-value="0"/>
</object-cache>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">
</sequence-manager>
</jdbc-connection-descriptor >
OBJ.properties
repositoryFile=repository.xml
useSerializedRepository=false
serializedRepositoryPath=.
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
maxActive=256
maxIdle=-1
maxWait=2000
timeBetweenEvictionRunsMillis=-1
minEvictableIdleTimeMillis=1000000
whenExhaustedAction=0
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl
ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
SqlGeneratorClass=org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl
IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl
ListProxyClass=org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl
SetProxyClass=org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl
CollectionProxyClass=org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl
StatementManagerClass=org.apache.ojb.broker.accesslayer.StatementManager
JdbcAccessClass=org.apache.ojb.broker.accesslayer.JdbcAccessImpl
RowReaderDefaultClass=org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl
descriptorBasedCaches=false
LockManagerClass=org.apache.ojb.broker.locking.LockManagerInMemoryImpl
LockTimeout=60000
OqlCollectionClass=org.apache.ojb.broker.util.collections.ManageableArrayList
SqlInLimit=200
ImplementationClass=org.apache.ojb.odmg.ImplementationImpl
OJBTxManagerClass=org.apache.ojb.odmg.LocalTxManager
cascadingDeleteOneToOne=false
cascadingDeleteOneToN=false
cascadingDeleteMToN=false
ImplicitLocking=true
LockAssociations=WRITE
DListClass=org.apache.ojb.odmg.collections.DListImpl
DArrayClass=org.apache.ojb.odmg.collections.DListImpl
DMapClass=org.apache.ojb.odmg.collections.DMapImpl
DBagClass=org.apache.ojb.odmg.collections.DBagImpl
DSetClass=org.apache.ojb.odmg.collections.DSetImpl
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew
JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]