Menu

#13 Potential threads overflow that can cause out of memory

open
nobody
7
2008-09-29
2008-09-29
wwang
No

In file: scci/src/org/starpound/cci/sip/Dispatcher.java, it used the follow code snip to create new worker thread:

new Thread() {
public void userAgent.onContinueInviteSipServerEvent(connectionParam, responseEventParam, messageQueueParam);
}
}.start();

There is no threshold on how many threads can be created, in a heavily loaded system, this can cause threads overflow and out of memory.

To solve the problem, we need to use thread pool with fixed number threads. The number of thread should be defined in a system properties.

Discussion


Log in to post a comment.