Java `OutOfMemoryError` when creating < 100 threads

后端 未结 4 1874
醉梦人生
醉梦人生 2020-12-16 17:26

I\'ve been reading and testing and banging my head on the wall for over a day because of this error.

I have some Java code in a class called Listener t

4条回答
  •  盖世英雄少女心
    2020-12-16 17:42

    Your problem is probably related with JVM being unable to allocate stack memory for new threads. Ironically, this problem can be solved by decreasing heap space (-Xmx) and stack space (-Xss). Check here, for instance, for a good explanation: http://www.blogsoncloud.com/jsp/techSols/java-lang-OutOfMemoryError-unable-to-create-new-native-thread.jsp

提交回复
热议问题