服务器线程过载
我在我的应用程序中使用 jsp-servlet。并在JBoss AS 7.0.2服务器上部署了战争。我有一个 servlet 在几秒内被调用很多次(比如说 500 次)。我认为这个线程不会由服务器处理。服务器抛出异常。
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
我还添加了最大堆内存并将其设置为 1024。但它对我不起作用。 有谁知道服务器将如何处理这么多线程? 我在正确的轨道上吗?
I am using the jsp-servlet in my application. and deployed the war on JBoss AS 7.0.2 server. i have servlet that is being called many time in sec (say 500 times). I think so this thread will not handled by the server. server throws an exception.
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
also i have added the max heap memory and set it to 1024. but it doesnot work for me.
is any one know how the server will handle the such many threads?
am i on the right track here ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“本机线程”暗示它不是 JVM 的线程。因此,JVM 内存设置不适用于此。至少不能直接查看这篇文章。
1) 尝试减小堆栈大小;
2) 尝试减少内存限制。
"Native thread" hints that it's not JVM's thread. Therefore, JVM memory settings do not apply to that. At least not directly, see this article.
1) Try reducing stack size;
2) Try decreasing memory limit.