Archived

This forum has been archived. Please start a new discussion on GitHub.

multithread call of ICE JAVA client

My server is writted by C++, and client is JAVA.
When I call the interface at client with JAVA in multithread. When count of thread is raised to 250 or above, some of JAVA threads cannot exit normally. And at client side has a lot of ESTABLISHED TCP connections, such as:

tcp 0 0 127.0.0.1:33419 127.0.0.1:33418 ESTABLISHED
tcp 0 0 127.0.0.1:33418 127.0.0.1:33419 ESTABLISHED
tcp 0 0 127.0.0.1:58616 127.0.0.1:58615 ESTABLISHED
tcp 0 0 127.0.0.1:48809 127.0.0.1:48810 ESTABLISHED
tcp 0 0 127.0.0.1:48810 127.0.0.1:48809 ESTABLISHED
tcp 0 0 127.0.0.1:60147 127.0.0.1:60146 ESTABLISHED
tcp 0 0 127.0.0.1:60146 127.0.0.1:60147 ESTABLISHED
tcp 0 0 127.0.0.1:58615 127.0.0.1:58616 ESTABLISHED
tcp 0 0 127.0.0.1:54985 127.0.0.1:54987 ESTABLISHED
tcp 0 0 127.0.0.1:54221 127.0.0.1:54222 ESTABLISHED
tcp 0 0 127.0.0.1:54222 127.0.0.1:54221 ESTABLISHED
tcp 0 0 127.0.0.1:54987 127.0.0.1:54985 ESTABLISHED
tcp 0 0 127.0.0.1:39351 127.0.0.1:39352 ESTABLISHED
tcp 0 0 127.0.0.1:47255 127.0.0.1:47254 ESTABLISHED
tcp 0 0 127.0.0.1:39352 127.0.0.1:39351 ESTABLISHED


My server is runed on Linux AS3 and client(JAVA) is Windows or Linux.

Comments

  • The reason is most likely that your VM doesn't have enough memory to run that many threads. What happens when memory runs is is out of the control of Ice. I suspect that you will need to allow for more virtual memory for your VM or reduce the number of threads.

    Why so many threads, BTW? It is highly unlikely that your application will perform better that way. Most likely, it will perform far worse than it would with fewer threads.

    Cheers,

    Michi.