There are some notes on performance at

http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/ptII3.0.2/doc/coding/performance.htm

Sometimes, as a workaround, all that is necessary is to increase the
size of the Java heap.  The java command takes
non-standard
commands like -Xmx<size> to set the maximum stack
size.  For example, under Cygwin, to run with a 256 megabyte heap
size:

export JAVAFLAGS=-Xmx256m
$PTII/bin/vergil

To see what other <code>-X</code> commands are available, run

java -X

I ran your example and it looks like there is a memory leak.
We'll take a look and see what's up

-Christopher

> Hi,
> 
> Sorry if you received this message for the second
> time..
> 
> I have a java.lang.OutOfMemory error problem with my
> model developed in Ptolemy II version 3.0.2.
> 
> I am working on a model which uses an ArrayToken (of
> 180 tokens) and my actors change the value of the
> tokens in each iteration. As tokens are immutable I am
> creating new tokens in each iteration. During the run
> time after several iterations the system stops with an
> error java.lang.OutOfMemory. I thought some problem
> with garbage collection is creating the problem so I
> tried calling System.gc at the end of fire() function
> in my actors but there was no change in the number of
> iterations before getting the error.
> 
> I tried to generate the same problem with the actors
> of Ptolemy and created a simple model using the
> ArrayExtract actor (the xml file is attached) and ran
> into the same problem after several iterations (6143
> iterations on a computer with 512MB Ram, Windows XP
> operating system, java version 1.4.2 ). 
> 
> Could you help me to find out the reason of this
> problem? And how can I continue the simulation without
> running out of memory?
> 
> Thanks,
> Nilgun Fescioglu Unver
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html
> --0-852522922-1080681987=:19410
> Content-Type: text/xml; name="memoryTest2.xml"
> Content-Description: memoryTest2.xml
> Content-Disposition: inline; filename="memoryTest2.xml"
> 
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
>     "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd";>
> <entity name="memoryTest2" class="ptolemy.actor.TypedCompositeActor">
>     <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttri
> bute" value="3.0.2">
>     </property>
>     <property name="DE Director" class="ptolemy.domains.de.kernel.DEDirector"
> >
>         <property name="startTime" class="ptolemy.data.expr.Parameter" value=
> "0.0">
>         </property>
>         <property name="stopTime" class="ptolemy.data.expr.Parameter" value="
> 1.7976931348623E308">
>         </property>
>         <property name="stopWhenQueueIsEmpty" class="ptolemy.data.expr.Parame
> ter" value="true">
>         </property>
>         <property name="synchronizeToRealTime" class="ptolemy.data.expr.Param
> eter" value="false">
>         </property>
>         <property name="isCQAdaptive" class="ptolemy.data.expr.Parameter" val
> ue="true">
>         </property>
>         <property name="minBinCount" class="ptolemy.data.expr.Parameter" valu
> e="2">
>         </property>
>         <property name="binCountFactor" class="ptolemy.data.expr.Parameter" v
> alue="2">
>         </property>
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="95.0, 35.0">
>         </property>
>     </property>
>     <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropert
> iesAttribute" value="{bounds={104, 174, 815, 518}}">
>     </property>
>     <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" valu
> e="[600, 400]">
>     </property>
>     <property name="annotation" class="ptolemy.kernel.util.Attribute">
>         <property name="_hideName" class="ptolemy.kernel.util.SingletonAttrib
> ute">
>         </property>
>         <property name="_iconDescription" class="ptolemy.kernel.util.Singleto
> nConfigurableAttribute">
>             <configure><svg><text x="20" y="20" style="font-size:14; font-fam
> ily:SansSerif; fill:blue">after 6143 iterations java lang.OutOfMemory error
> 
> </text></svg></configure>
>         </property>
>         <property name="_smallIconDescription" class="ptolemy.kernel.util.Sin
> gletonConfigurableAttribute">
>             <configure>
>       <svg>
>         <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y
> ="20">-A-</text>
>       </svg>
>     </configure>
>         </property>
>         <property name="_controllerFactory" class="ptolemy.vergil.basic.NodeC
> ontrollerFactory">
>         </property>
>         <property name="_editorFactory" class="ptolemy.vergil.toolbox.Annotat
> ionEditorFactory">
>         </property>
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="70.0, 235.0">
>         </property>
>     </property>
>     <entity name="SingleEvent" class="ptolemy.domains.de.lib.SingleEvent">
>         <property name="time" class="ptolemy.data.expr.Parameter" value="0.0"
> >
>         </property>
>         <property name="value" class="ptolemy.data.expr.Parameter" value="{0.
> 0944506216287, 0.0975191625284, 0.0944506216287, 0.0857999241191, 0.073067950
> 4667, 0.0582762735578, 0.0434458637753, 0.0301629913445, 0.0193529221347, 0.0
> 112813340563, 0.0084582314143, 0.0049053935788, 0.0027967090808, 0.0016312805
> 584, 0.0010305804697, 7.414891291827E-4, 6.1146737601312E-4, 5.5677601186248E
> -4, 5.3524811455656E-4, 5.2731439069799E-4, 5.2457583224341E-4, 5.23690135299
> 95E-4, 5.2342166719598E-4, 5.2334537982137E-4, 5.2332505352927E-4, 5.23319974
> 39197E-4, 5.2331878392172E-4, 5.2331852216018E-4, 5.2331846815861E-4, 5.23318
> 45770494E-4, 5.233184558059E-4, 5.2331845548212E-4, 5.2331845543031E-4, 5.233
> 1845542253E-4, 5.2331845542143E-4, 5.2331845542128E-4, 5.2331845542126E-4, 5.
> 2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4,
>  5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E
> -4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5!
>  .2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-
> 4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.233184554212
> 6E-4, 5.2331845542126E-4, 5.2331845542128E-4, 5.2331845542143E-4, 5.233184554
> 2253E-4, 5.2331845543031E-4, 5.2331845548212E-4, 5.233184558059E-4, 5.2331845
> 770494E-4, 5.2331846815861E-4, 0.0, 5.2331878392172E-4, 5.2331997439197E-4, 5
> .2332505352927E-4, 5.2334537982137E-4, 5.2342166719598E-4, 5.2369013529995E-4
> , 5.2457583224341E-4, 5.2731439069799E-4, 5.3524811455656E-4, 5.5677601186248
> E-4, 6.1146737601312E-4, 7.414891291827E-4, 0.0010305804697, 0.0016312805584,
>  0.0027967090808, 0.0049053935788, 0.0084582314143, 0.0112813340563, 0.019352
> 9221347, 0.0301629913445, 0.0434458637753, 0.0582762735578, 0.0730679504667, 
> 0.0857999241191}">
>         </property>
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="90.0, 145.0">
>         </property>
>         <port name="output" class="ptolemy.actor.TypedIOPort">
>             <property name="output"/>
>         </port>
>     </entity>
>     <entity name="TimedDelay" class="ptolemy.domains.de.lib.TimedDelay">
>         <property name="delay" class="ptolemy.data.expr.Parameter" value="0.0
> ">
>         </property>
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="295.0, 60.0">
>         </property>
>         <port name="input" class="ptolemy.domains.de.kernel.DEIOPort">
>             <property name="input"/>
>             <property name="_cardinal" class="ptolemy.kernel.util.StringAttri
> bute" value="EAST">
>             </property>
>         </port>
>         <port name="output" class="ptolemy.domains.de.kernel.DEIOPort">
>             <property name="output"/>
>             <property name="_cardinal" class="ptolemy.kernel.util.StringAttri
> bute" value="WEST">
>             </property>
>         </port>
>     </entity>
>     <entity name="Display" class="ptolemy.actor.lib.gui.Display">
>         <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" va
> lue="10">
>         </property>
>         <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter"
>  value="40">
>         </property>
>         <property name="title" class="ptolemy.kernel.util.StringAttribute">
>         </property>
>         <property name="_windowProperties" class="ptolemy.actor.gui.WindowPro
> pertiesAttribute">
>         </property>
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="535.0, 125.0">
>         </property>
>         <port name="input" class="ptolemy.actor.TypedIOPort">
>             <property name="input"/>
>             <property name="multiport"/>
>         </port>
>     </entity>
>     <entity name="ArrayExtract" class="ptolemy.actor.lib.ArrayExtract">
>         <property name="sourcePosition" class="ptolemy.data.expr.Parameter" v
> alue="0">
>         </property>
>         <property name="extractLength" class="ptolemy.data.expr.Parameter" va
> lue="90">
>         </property>
>         <property name="destinationPosition" class="ptolemy.data.expr.Paramet
> er" value="0">
>         </property>
>         <property name="outputArrayLength" class="ptolemy.data.expr.Parameter
> " value="90">
>         </property>
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="325.0, 145.0">
>         </property>
>         <port name="input" class="ptolemy.actor.TypedIOPort">
>             <property name="input"/>
>         </port>
>         <port name="output" class="ptolemy.actor.TypedIOPort">
>             <property name="output"/>
>         </port>
>     </entity>
>     <entity name="Counter" class="ptolemy.actor.lib.Counter">
>         <property name="_location" class="ptolemy.kernel.util.Location" value
> ="515.0, 55.0">
>         </property>
>         <port name="increment" class="ptolemy.actor.TypedIOPort">
>             <property name="input"/>
>         </port>
>         <port name="decrement" class="ptolemy.actor.TypedIOPort">
>             <property name="input"/>
>         </port>
>         <port name="output" class="ptolemy.actor.TypedIOPort">
>             <property name="output"/>
>         </port>
>     </entity>
>     <relation name="relation" class="ptolemy.actor.TypedIORelation">
>         <vertex name="vertex1" value="485.0, 150.0">
>         </vertex>
>     </relation>
>     <relation name="relation5" class="ptolemy.actor.TypedIORelation">
>     </relation>
>     <relation name="relation3" class="ptolemy.actor.TypedIORelation">
>         <vertex name="vertex1" value="170.0, 145.0">
>         </vertex>
>     </relation>
>     <link port="SingleEvent.output" relation="relation3"/>
>     <link port="TimedDelay.input" relation="relation"/>
>     <link port="TimedDelay.output" relation="relation3"/>
>     <link port="Display.input" relation="relation"/>
>     <link port="Display.input" relation="relation5"/>
>     <link port="ArrayExtract.input" relation="relation3"/>
>     <link port="ArrayExtract.output" relation="relation"/>
>     <link port="Counter.increment" relation="relation"/>
>     <link port="Counter.output" relation="relation5"/>
> </entity>
> 
> --0-852522922-1080681987=:19410--
> 
> ----------------------------------------------------------------------------
> Posted to the ptolemy-hackers mailing list.  Please send administrative
> mail for this list to: [EMAIL PROTECTED]

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to