RE: [jade-develop] Memory Leak in CyclicBehaviour/Receiver BehaviourJADE2.5??


Subject: RE: [jade-develop] Memory Leak in CyclicBehaviour/Receiver BehaviourJADE2.5??
From: Bellifemine Fabio (Fabio.Bellifemine@TILAB.COM)
Date: Fri Aug 02 2002 - 13:48:19 MET DST


James, there is a benchmark add-on available in the add-on area of the web site and also a paper in the paper area.

-----Original Message-----
From: James Aldridge [mailto:james.aldridge@fdlearning.com]
Sent: 02 August 2002 12:54
To: 'Bellifemine Fabio'
Subject: RE: [jade-develop] Memory Leak in CyclicBehaviour/Receiver
BehaviourJADE2.5??

Thank you,

Your guidance was extremely useful. I have made a few changes along the lines of your suggestions below, and now have an Agent System that seems to poll/idle quite happily without gradually eating up memory.

Just out of interest, have you performed any benchmarking or performance tests on the JADE platform?

Many thanks again,

James.

-----Original Message-----
From: jade-develop-admin@sharon.cselt.it
[mailto:jade-develop-admin@sharon.cselt.it]On Behalf Of Bellifemine
Fabio
Sent: 31 July 2002 17:54
To: james.aldridge@fdlearning.com; jade-develop@sharon.cselt.it
Subject: RE: [jade-develop] Memory Leak in CyclicBehaviour/Receiver
Behaviour JADE2.5??

James, there are a number of optimization and not completely correct
things you are doing:
- the method getInternalPollingTemplate() creates a number of new java
objects everytime is called but, on the other hand, they never change.
Better move it into the constructor of the behaviour.
- everytime the method action is called you create a new
ReceiverBehaviour. Probably in your case a better pattern is the
following:
public void action() {
 ACLMessage msg = receive();
 if (msg == null) {
   block(); // block until a new message arrives
   return;
 } else {
   // here put all your code that matches the message against a number
of templates.
 }

-----Original Message-----
From: James Aldridge [mailto:james.aldridge@fdlearning.com]
Sent: 31 July 2002 17:31
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] Memory Leak in CyclicBehaviour/Receiver
Behaviour JADE2.5??

(Apologies if posted more than once - email problems)

Our system is based on a number of agents each with a CyclicBehaviour
that
polls for incoming ACL messages. These Cyclic Behaviours (initiated at
agent startup) use a ReceiverBehaviour and MessageTemplates to determine
the
incoming message, and call another behaviour(s) based on the template.

I have been testing the system recently, and noticed that as the system
is
idling (i.e. no inter-agent messages are being sent, the agents are just
cycling / polling for incoming messages) the memory usage on the machine
is
gradually rising.

This is of concern to me because, as far as I can see from my code,
there is
no obvious point at which memory leaks may be occuring.

Has anyone else experienced memory leaks using the JADE platform, and in
particular CyclicBehaviour / ReceiverBehaviour?

I have attached a code snippet from one of my agents showing the Cyclic
behaviour (note that this is an inner class of an agent called
KPPMonitor).
I am using JADE 2.5, JRE 1.3.1 on Windows NT. Am I doing something
stupid
somewhere?

Please note that processor usage is not affected (this remains pretty
low
and constant during the cycling).

Any help or guidance would be very much appreciated.

Regards,

James.

James Aldridge
Developer - European Projects
Knowledge On Demand (KOD)
FD Learning Ltd.

james.aldridge@fdlearning.com

The information transmitted in this electronic mail message may contain
confidential and or privileged materials. For full details and
restrictions
see http://disclaimer.fdlearning.com

_______________________________________________
jade-develop mailing list
jade-develop@sharon.cselt.it
http://sharon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT http://jade.cselt.it/mailing.htm#unsubscribe



This archive was generated by hypermail 2a22 : Fri Aug 02 2002 - 13:48:40 MET DST