cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjoseph...@yahoo.com>
Subject Re: out or memory error (OJB/JDO/FlowScript)
Date Wed, 17 Nov 2004 14:00:07 GMT
Hi Antonio,

Thank you very much for replying.  I read your example
VERY closely and am trying to follow the same
especially your remark about the persistent manager to
be created only once.

I am using Cocoon 2.1.5.1

also some additional info. in case it helps (hopefully
doesn't bore you!)

I am using Sun's JDO reference implementation.... and
calling it from a Cocoon flow script using the latest
available OJB jars (db-ojb-1.0.1-*.jar)

public Object[] getObjectList(JdoPMF pmf, Object obj,
String filter, String ordering) {
    Criteria criteria = null;
    Collection objects = null;
    PersistenceManager pm =
pmf.getPersistenceManager();
    PersistenceBroker broker = null;
    if(obj == null)
        return null;
    try {
		broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
		broker.clearCache();
        System.out.println("Filter is: " + filter);
	    System.out.println("Ordering is: " + ordering);
        Query query = pm.newQuery(obj.getClass(),
filter);
	    System.out.println("Filter is: " + filter);
	    if(ordering!=null)
	        query.setOrdering(ordering);
	        System.out.println("Ordering is: " +
ordering);
        pm.currentTransaction().begin();
	    objects = (Collection)query.execute();
	    pm.currentTransaction().commit();
	} catch (Exception sqle) {
		sqle.printStackTrace();
	    String msg = sqle.getMessage();
		return null;
	}
	if(broker != null)
	{
	  broker.close();                                    
        // Release broker instance to the broker-pool
    }
	return objects.toArray();
}

When I pass in the persistentmanager instead of the
factory, then it does slightly better - 35 times
before it breaks with the same error.

I bumped up the JVM heapsize as follows, but it seemed
to have *zero* effect (in Catalina50.bat):

set JAVA_OPTS=-Xms128m -Xmx400m

I also am using the default cache implementation with
clearing of cache specified at 5 secs. in my
repository.xml as follows:

<object-cache
class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
<attribute attribute-name="timeout"
attribute-value="5"/>
</object-cache>
        <connection-pool maxActive="25"
validationQuery="" />
        <sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl"
/>
   </jdbc-connection-descriptor>


Any help would be much appreciated!!

I am running on XP with Tomcat 5.2x and JDK1.4

thx
Paul

--- Antonio Gallardo <agallardo@agssa.net> wrote:

> Hi Paul:
> 
> Please provide cocoon version.
> 
> But before reply, please try to allow your tomcat
> use more memory.
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> Paul Joseph dijo:
> > Hi,
> >
> > I tried to ask this question at the apache ojb
> list,
> > but it bounced..so thought I'd try here!
> >
> > Using Flow script, I have a query that retrives
> about
> > 250 rows of data.
> >
> > After I run it about 10 times, it fails to run and
> an
> > examination of the Tomcat logs indicates that it
> ran
> > out of memory.
> >
> > I am using Sun's JDO reference implementation....
> and
> > calling it from a Cocoon flow script using the
> 1.0.1
> > ojb libs.
> >
> > Any help would be much appreciated!
> >
> > thx
> > Paul
> >
> > ==========
> > [JDO] DEBUG: OjbStoreConnector.begin:
> > connectionReadyForRelease=false
> > java.lang.OutOfMemoryError
> > org.apache.ojb.broker.PersistenceBrokerException:
> > java.lang.OutOfMemoryError
> > 	at
> >
>
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> > Source)
> > 	at
> >
>
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> > Source)
> > 	at
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown
> > Source)
> > 	at
> >
>
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown
> > Source)
> > 	at
> >
>
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown
> > Source)
> > 	at
> org.apache.ojb.jdori.sql.OjbExtent.<init>(Unknown
> > Source)
> > 	at
> >
>
org.apache.ojb.jdori.sql.OjbStoreManager.getExtent(Unknown
> > Source)
> > 	at
> >
>
com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
> > Source)
> > 	at
> >
>
com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
> > Source)
> > 	at
> >
> com.sun.jdori.common.query.QueryImpl.execute(Unknown
> > Source)
> > 	at
> >
>
org.apache.cocoon.ojb.samples.SuperDAO.getObjectList(SuperDAO.java:227)
> > 	at
> >
>
sun.reflect.GeneratedMethodAccessor137.invoke(Unknown
> > Source)
> > 	at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > 	at
> java.lang.reflect.Method.invoke(Method.java:324)
> > 	at
> >
>
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
> > 	at
> >
>
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> > 	at
> >
>
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134)
> > 	at
> >
>
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
> > 	at
> >
>
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
> > 	at
> >
>
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
> > 	at
> >
>
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> > 	at
> >
>
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:702)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
> > 	at
> >
>
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
> 
=== message truncated ===


=====
This communication, including attachments, is for the exclusive use of 
the addressee and may contain proprietary, confidential, or privileged
information.  If you are not the intended recipient, any use, copying,
disclosure, dissemination, or distribution is strictly prohibited.  If 
you are not the intended recipient, please notify the sender by return mail and delete this
communication and destroy all copies.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message