pool threads are not killed

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

vaibhavkashyap
Posts: 28
Joined: 23 Aug 2012, 12:56

pool threads are not killed

Postby vaibhavkashyap » 23 Aug 2012, 13:14

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.?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: pool threads are not killed

Postby Lapo » 23 Aug 2012, 14:45

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?
Lapo
--
gotoAndPlay()
...addicted to flash games
vaibhavkashyap
Posts: 28
Joined: 23 Aug 2012, 12:56

Re: pool threads are not killed

Postby vaibhavkashyap » 24 Aug 2012, 06:27

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)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: pool threads are not killed

Postby Lapo » 24 Aug 2012, 06:46

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.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: pool threads are not killed

Postby Lapo » 24 Aug 2012, 06:49

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
Lapo

--

gotoAndPlay()

...addicted to flash games
vaibhavkashyap
Posts: 28
Joined: 23 Aug 2012, 12:56

Re: pool threads are not killed

Postby vaibhavkashyap » 24 Aug 2012, 09:29

Thanks a ton.. :) :)

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 13 guests