Re: memory problem

2004-03-31 Thread Christopher Hylands Brooks
This bounced because of configuration problem on the mail server,
so I'm resending it.

-Christopher
--- Forwarded Message


From: Stephen Andrew Neuendorffer [EMAIL PROTECTED]
To: Nilgun Fescioglu Unver [EMAIL PROTECTED],
[EMAIL PROTECTED],
[EMAIL PROTECTED]
Subject: [Ptolemy] Re: memory problem
Date: Wed, 31 Mar 2004 08:55:16 -0800


The culprit is apparently the Display actor, which internally uses
a JTextArea, which is a known memory hog:

A quick google search turns up:

 I can't believe this exists in Swing, but I've found
 that when I loaded a 2MB file into JTextArea it
 creates literally 394,000+ java.lang.ref.Finalizer
 objects that hang around event after the JTextArea is
 released. What's worse is my memory usage spikes to
 65MB! That's 30 times the size of the text string! I
 don't know what java.lang.ref.Finalizer object is, or
 why it gets created.

After 6000 iterations, that's roughly 1.3 MB of text

At 01:26 PM 3/30/2004 -0800, Nilgun Fescioglu Unver wrote:
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

Attachment deleted


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


memory problem

2004-03-30 Thread Nilgun Fescioglu Unver
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?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.VersionAttribute 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.Parameter value=true
/property
property name=synchronizeToRealTime class=ptolemy.data.expr.Parameter value=false
/property
property name=isCQAdaptive class=ptolemy.data.expr.Parameter value=true
/property
property name=minBinCount class=ptolemy.data.expr.Parameter value=2
/property
property name=binCountFactor class=ptolemy.data.expr.Parameter value=2
/property
property name=_location class=ptolemy.kernel.util.Location value=95.0, 35.0
/property
/property
property name=_windowProperties class=ptolemy.actor.gui.WindowPropertiesAttribute value={bounds={104, 174, 815, 518}}
/property
property name=_vergilSize class=ptolemy.actor.gui.SizeAttribute value=[600, 400]
/property
property name=annotation class=ptolemy.kernel.util.Attribute
property name=_hideName class=ptolemy.kernel.util.SingletonAttribute
/property
property name=_iconDescription class=ptolemy.kernel.util.SingletonConfigurableAttribute
configuresvgtext x=20 y=20 style=font-size:14; font-family:SansSerif; fill:blueafter 6143 iterations java lang.OutOfMemory error

/text/svg/configure
/property
property name=_smallIconDescription class=ptolemy.kernel.util.SingletonConfigurableAttribute
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.NodeControllerFactory
/property
property name=_editorFactory class=ptolemy.vergil.toolbox.AnnotationEditorFactory
/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.0730679504667, 0.0582762735578, 0.0434458637753, 0.0301629913445, 0.0193529221347, 0.0112813340563, 0.0084582314143, 0.0049053935788, 0.0027967090808, 0.0016312805584, 0.0010305804697, 7.414891291827E-4, 6.1146737601312E-4, 5.5677601186248E-4, 5.3524811455656E-4, 5.2731439069799E-4, 5.2457583224341E-4, 5.2369013529995E-4, 5.2342166719598E-4, 5.2334537982137E-4, 5.2332505352927E-4, 5.2331997439197E-4, 5.2331878392172E-4, 5.2331852216018E-4, 5.2331846815861E-4, 5.2331845770494E-4, 5.233184558059E-4, 5.2331845548212E-4, 5.2331845543031E-4, 5.2331845542253E-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,