Hi, I have a Java Agent that must send multiple mails to several people, one by one.This mail is with the attach form true.
Using
public void send(boolean attachform, String recipient)
throws NotesException
But when I run, something is wrong and after severals mails send (20-35) the agent hangs and i nedd to kill my notes applications, because is not responding.
Objects in Java must be recycled when you want to reuse a reference to them. This holds true in Notes / Domino when going through documents in a view or sending multiple emails. Recycling an object means that it is released from memory (The Heap) by the Garbage Collector. If you do not release objects, Java will create a new instance of the object in memory every time the object is initiated until the memory will fill up and the computer can precede no more. Add the following line to your code after the docMemo.Send
It might have to do with this recycle-thing. You must be carefull with it, when using Java for Domino objects. For example look at recycling section of this article: