Error cleaning up agent threads

I have an agent written in Java that is displaying the subject error. I would post the code here; but it is quite large. I can send via email if you can possibly help.

I added the code in technote 1141368 to display the threads ids. It looks like something is creating threads; but how do I kill them? We are running into memory problems after the agent executes a few times. I have added system.gc() and made sure I recycled all the notes objects after use. I assume that the threads are still hung out there somewhere.

Here is the threadgroup messages…

02/08/2008 10:33:20 PM Agent printing: Dump the current threadgroup at start:

02/08/2008 10:33:20 PM Agent printing: ThreadGroup UTG: JavaAgent, objid = 1994667628

02/08/2008 10:33:20 PM Agent printing: subgroups = 0

02/08/2008 10:33:20 PM Agent printing: total threads = 1

02/08/2008 10:33:20 PM Agent printing:

Thread Name, ThreadID, ThreadGroup

02/08/2008 10:33:20 PM Agent printing: AgentThread: JavaAgent, 77166189, UTG: JavaAgent

02/08/2008 10:33:43 PM Agent printing: Dump the current threadgroup at end:

02/08/2008 10:33:43 PM Agent printing: ThreadGroup UTG: JavaAgent, objid = 1994667628

02/08/2008 10:33:43 PM Agent printing: subgroups = 0

02/08/2008 10:33:43 PM Agent printing: total threads = 5

02/08/2008 10:33:43 PM Agent printing:

Thread Name, ThreadID, ThreadGroup

02/08/2008 10:33:43 PM Agent printing: AgentThread: JavaAgent, 77166189, UTG: JavaAgent

02/08/2008 10:33:43 PM Agent error: Error cleaning up agent threads

Thanks for any help you can provide, I’m at a loss.

Subject: Error cleaning up agent threads

Usually this happens, when the agent is call over the browser and request has not been finish yet. ( On another words, user are not waiting until agent finish his job, but for example close browser or went to another page. ) Send me whole code of agent, will have a look.

Stefan

Subject: Error cleaning up agent threads

I found my error and admit it was actually pretty stupid. I had another java class that “extended AgentBase” in addition to the normal “JavaAgent” extension.

public class JavaAgent extends AgentBase {

public void NotesMain() {

}

}

class InterestAccount extends AgentBase {

}

Every time the class was instantiated, it created another thread. Removing the “extends AgentBase” from the class fixed the problem of extra threads.

Cut&Paste got me again :slight_smile: