[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
memory problems again
From: |
Juan A Rodriguez |
Subject: |
memory problems again |
Date: |
Thu, 13 Jan 2000 13:10:33 -0500 |
Hi Marcus,
Finally I incorporated the solution below into my code.
And again I've got the same memory problems.
By calling Globals.env.dumpDirectory() I see that the memory gets filled with
FArguments and FCall objects.
Do you know how I can get rid of this objects once used by the scheduler?
juan
>>import swarm.objectbase.SwarmImpl;
>>import swarm.defobj.Zone;
>>import swarm.activity.Schedule;
>>import swarm.activity.ScheduleImpl;
>>import swarm.objectbase.Swarm;
>>import swarm.activity.Activity;
>>import swarm.defobj.FCallImpl;
>>import swarm.defobj.FCall;
>>import swarm.defobj.FArgumentsImpl;
>>import swarm.defobj.FArgumentsCImpl;
>>import swarm.defobj.FArguments;
>>import swarm.defobj.FArgumentsC;
>>import swarm.Selector;
>>import swarm.Globals;
>>
>>public class TestFAction extends SwarmImpl {
>> TestFAction (Zone aZone) {
>> super (aZone);
>> }
>> Schedule schedule;
>> Schedule stopSchedule;
>>
>> public void stepSwarm (long val) {
>> System.out.println ("step @ " + Globals.env.getCurrentTime () +
>> " val: " + val);
>> }
>>
>> public void stopSwarm () {
>> getActivity ().terminate ();
>> }
>>
>> FCall createCall () {
>> try {
>> FArgumentsC creating = new FArgumentsCImpl (new FArgumentsImpl ());
>> Selector sel = new Selector (getClass (), "stepSwarm", false);
>>
>> creating.createBegin (getZone ());
>> creating.setJavaFlag (true);
>> creating.setSelector (sel);
>> creating.addLongLong (100);
>> return new FCallImpl (getZone (), this, sel,
>> (FArguments) creating.createEnd ());
>> } catch (Exception e) {
>> e.printStackTrace (System.err);
>> }
>> return null;
>> }
>>
>> FCall createStopCall () {
>> try {
>> Selector sel = new Selector (getClass (), "stopSwarm", false);
>> return new FCallImpl (getZone (), this, sel,
>> new FArgumentsImpl (getZone (), sel, true));
>> } catch (Exception e) {
>> e.printStackTrace (System.err);
>> }
>> return null;
>> }
>>
>> public Object buildActions () {
>> super.buildActions ();
>>
>> schedule = new ScheduleImpl (this, 1);
>> stopSchedule = new ScheduleImpl (this, true);
>> schedule.at$createFAction (0, createCall ());
>> stopSchedule.at$createFAction (10, createStopCall ());
>> return this;
>> }
>>
>> public Activity activateIn (Swarm swarmContext) {
>> super.activateIn (swarmContext);
>>
>> schedule.activateIn (this);
>> stopSchedule.activateIn (this);
>> return getActivity ();
>> }
>>
>>
>> static void main (String[] args) {
>> Globals.env.initSwarm ("TestFAction", "0.0", "address@hidden",
>> args);
>>
>> TestFAction testFAction = new TestFAction (Globals.env.globalZone);
>>
>> testFAction.buildObjects ();
>> testFAction.buildActions ();
>> testFAction.activateIn (null).run ();
>> }
>>}
>>
>>
>> ==================================
>> Swarm-Support is for discussion of the technical details of the day
>> to day usage of Swarm. For list administration needs (esp.
>> [un]subscribing), please send a message to <address@hidden>
>> with "help" in the body of the message.
>>
>----------------------------------------------------------------------
> Juan A. Rodriguez
> Center for Coordination Sciences
> MIT Sloan School of Management
>
> MIT Room E40-173a
> Cambridge, MA 02139
> Tel. +1 (617) 253-2430
> email: address@hidden
>----------------------------------------------------------------------
>
----------------------------------------------------------------------
Juan A. Rodriguez
Center for Coordination Sciences
MIT Sloan School of Management
MIT Room E40-173a
Cambridge, MA 02139
Tel. +1 (617) 253-2430
email: address@hidden
----------------------------------------------------------------------
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- last-fence fall, Jonathan Impett, 2000/01/11
- Re: last-fence fall, Marcus G. Daniels, 2000/01/11
- Re: last-fence fall, J.F. Impett, 2000/01/11
- Re: last-fence fall, Marcus G. Daniels, 2000/01/11
- Re: last-fence fall, Jonathan Impett, 2000/01/13
- Re: last-fence fall, Marcus G. Daniels, 2000/01/13
- memory problems again,
Juan A Rodriguez <=
- Re: memory problems again, Marcus G. Daniels, 2000/01/13
- Re: memory problems again, Juan A. Rodriguez, 2000/01/13
- Re: last-fence fall, Jonathan Impett, 2000/01/13
- Re: last-fence fall, Jayshree Sarma, 2000/01/13