cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
274
Views
0
Helpful
2
Replies

JTAPI java memory problem

peter0601
Level 1
Level 1

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

2 Replies 2

amritpatek
Level 6
Level 6

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.

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: