使用Jmeter在Apache Ignite中生成多个客户端时出现以下错误。启动Apache Ignite客户端时应该是什么堆大小?我试着保持超过512MB,但我仍然得到同样的错误。
Nov 02, 2016 6:54:20 PM org.apache.ignite.logger.java.JavaLogger error
SEVERE: Got exception while starting (will rollback startup routine).
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor.start(GridTimeoutProcessor.java:71)
at org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1589)
at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:839)
at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1739)
at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)
at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:569)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:516)
at org.apache.ignite.Ignition.start(Ignition.java:322)
at ignite_client_jmeter.runTest(ignite_client_jmeter.java:1404)
at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:196)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:1)
首先,此错误与堆内存无关,它表示您在一个进程中启动了操作系统允许的更多线程。在Linux上,您可以使用ulimit
来解决此问题。
其次,看起来你在一个JVM中启动了多个客户端,这是一种不好的做法。 Ignite
实例是线程安全的,可以由多个线程同时使用。因此,最好每个JVM创建一个客户端,然后将其用于与集群的所有交互。