JTAPI java memory problem

Unanswered Question
Sep 8th, 2008

Hi folks,

I have to monitor up to 800 phones at once. I place an CallObserver on every terminal. I get the terminals' names via AXL. All works fine and the program is running for several hours. I have allocated 1024 MB of memory to the java heap. After those few hours the java process is still running but does not do anything (e.g. writing logs or DB entries). If I look up the machines' performance I can see that the RAM of the machine is full.

Is there a way to decrease memory usage with better programming style?

I place the observers in the following way where 'phones' is an array and contains the SEP... address of the phones:

for (int i=0; phones.size() > i; i++){

try {

Terminal term = provider.getTerminal(phones.get(i));

term.addCallObserver(new MyCallObserver());

System.out.println(phones.get(i));

}catch (Exception e){

e.printStackTrace();

}

}

I appreciate any help!!

Thx in advance and if one needs more information I will provide as much as I can!

Regards

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
amritpatek Mon, 09/15/2008 - 06:04

Modify the script with the following and retest thescenario:

Instantiate peer = JtapiPeerFactory.getJtapiPeer(null) ones instead of instantiating every time in the loop.

Invoke Provider.shutdown only after provider becomes Inservice (Cisco Jtapi will send ProviderInServiceEvent after it goes inService) instead of shutting down as soon application gets the provider.

peter0601 Sun, 09/21/2008 - 22:51

Thanks amritpatek,

I do instantiate the peer variable before I start the loop to get the terminals.

One question to your second suggestion about the provider shutdown. Why should I shut down the provider if I want to monitor the terminals continously? I mean my application should monitor the phones on a permanent basis not just for a few minutes. Maybe you can offer a brief explanation what you mean with your post. Thanks in advance again for your help!!!

Cheers

Peter

Actions

This Discussion