Page 1 of 1

pool threads are not killed

Posted: 23 Aug 2012, 13:14
by vaibhavkashyap
we have made poker game using your server. For user who sits over the table is been allocated with four threads
1) smart fox
2) thread made by us for tracking user.
3) timer
4) pool thread (we do not know the source which is responsible for its generation and even it has no relation with our source code)

All the first three threads are killed as soon as the game is finished. But the pool thread remains their in waiting state. The same scenario repeats for each game . Therefore at the end of the day threads count becomes in large number.

please suggest us how could we resolve this problem.?

Re: pool threads are not killed

Posted: 23 Aug 2012, 14:45
by Lapo
The server uses several thread pools, but they are fixed, they don't grow at runtime. When you launch a new game no thread pool should be generated, if this happens it should depends on your code. Maybe you are creating new Task Schedulers?

Re: pool threads are not killed

Posted: 24 Aug 2012, 06:27
by vaibhavkashyap
following exception is thrown :

Super Bot : Refreshing BOT accounts
Exception in thread "Timer-224" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:657)
at java.util.Timer.<init>(Timer.java:160)
at java.util.Timer.<init>(Timer.java:132)
at sfs2x.client.util.LagMonitor.<init>(LagMonitor.java:36)
at sfs2x.client.util.LagMonitor.<init>(LagMonitor.java:24)
at sfs2x.client.SmartFox.reset(SmartFox.java:195)
at sfs2x.client.SmartFox.initialize(SmartFox.java:182)
at sfs2x.client.SmartFox.<init>(SmartFox.java:127)
at sfs2x.client.SmartFox.<init>(SmartFox.java:132)
at sfs2x.client.example.BotSpawner.init(BotSpawner.java:631)
at sfs2x.client.example.BotSpawner$Reconnect.run(BotSpawner.java:141)
at java.util.TimerThread.mainLoop(Timer.java:534)
at java.util.TimerThread.run(Timer.java:484)

Re: pool threads are not killed

Posted: 24 Aug 2012, 06:46
by Lapo
Ok, so this is a client problem, not a server side one.
That explains a few things at least. I am moving this discussion under the SFS2X Java Client API section.

Re: pool threads are not killed

Posted: 24 Aug 2012, 06:49
by Lapo
I think a similar issue was reported a few days ago:
viewtopic.php?f=22&t=14621

Thomas Lund is already on it, you should expect a fix soon.
cheers

Re: pool threads are not killed

Posted: 24 Aug 2012, 09:29
by vaibhavkashyap
Thanks a ton.. :) :)