09-08-2008 07:53 AM - edited 03-15-2019 01:06 PM
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
09-15-2008 06:04 AM
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.
09-21-2008 10:51 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide