SpoutDev/Spout — Issue #879: Spout eats a lot of memory randomly
Author: robxu9
Created: 2011-11-06 01:22:53+00:00
State: open

Spout seems to grab memory so much sometimes that it kills the server.
Like for instance, one time as soon as I started up the server, and a person with Spoutcraft logged in (1 minute after server finished starting), I get this:

```
2011-11-05 18:39:11 [SEVERE] java.lang.OutOfMemoryError: unable to create new native thread
2011-11-05 18:39:11 [SEVERE]	at java.lang.Thread.start0(Native Method)
2011-11-05 18:39:11 [SEVERE]	at java.lang.Thread.start(Thread.java:640)
2011-11-05 18:39:11 [SEVERE]	at org.getspout.spout.player.SimpleFileManager.onPlayerJoin(SimpleFileManager.java:92)
2011-11-05 18:39:11 [SEVERE]	at org.getspout.spout.PlayerManager.onSpoutcraftEnable(PlayerManager.java:78)
2011-11-05 18:39:11 [SEVERE]	at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:142)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:36)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
2011-11-05 18:39:11 [SEVERE]	at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:501)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
2011-11-05 18:39:11 [SEVERE]	at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
2011-11-05 18:39:11 [SEVERE] Unexpected exception
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at org.getspout.spout.player.SimpleFileManager.onPlayerJoin(SimpleFileManager.java:92)
at org.getspout.spout.PlayerManager.onSpoutcraftEnable(PlayerManager.java:78)
at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:142)
at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:36)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:501)
at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
```

And then nobody can connect the server.

Other times this will happen just randomly out of the blue, or if someone triggers a GUI.

This problem plagues our server, can someone help?