私はTomcat6でliferay6.0.6を使用し、terracotta3.5.4を使用しています。別のサーバーにテラコッタをインストールすると、正常に動作します。
Debianシステムとredhatシステムは仮想マシンであり、まったく同じ仮想ハードウェアを使用します。1 cpu、4gb ram、両方とも64ビットOS。
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Debianシステムを使用してアプリケーションを起動すると、すべてが期待どおりに機能します。
RedHatシステムを使用している場合、エラーが発生します:
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:176)
at com.tc.object.locks.ClientLockManagerImpl.<init>(ClientLockManagerImpl.java:39)
at com.tc.object.StandardDSOClientBuilder.createLockManager(StandardDSOClientBuilder.java:190)
at com.tc.object.DistributedObjectClient.start(DistributedObjectClient.java:639)
at com.tc.object.bytecode.ManagerImpl$2.execute(ManagerImpl.java:263)
at com.tc.lang.StartupHelper.startUp(StartupHelper.java:39)
at com.tc.object.bytecode.ManagerImpl.startClient(ManagerImpl.java:281)
at com.tc.object.bytecode.ManagerImpl.init(ManagerImpl.java:202)
at com.tc.object.bytecode.ManagerImpl.init(ManagerImpl.java:190)
at com.tc.object.bytecode.hook.impl.DSOContextImpl.createStandaloneContext(DSOContextImpl.java:179)
at org.terracotta.express.StandaloneL1Boot.call(StandaloneL1Boot.java:190)
at org.terracotta.express.ClientImpl.<init>(ClientImpl.java:309)
at org.terracotta.express.ClientFactoryImpl.newClient(ClientFactoryImpl.java:232)
at org.terracotta.express.ClientFactoryImpl.createClient(ClientFactoryImpl.java:225)
at org.terracotta.express.ClientFactoryImpl.createClient(ClientFactoryImpl.java:212)
at org.terracotta.express.ClientFactoryImpl.getOrCreateClient(ClientFactoryImpl.java:190)
at org.terracotta.express.ClientFactory.getOrCreateClient(ClientFactory.java:28)
at net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.<init>(StandaloneTerracottaClusteredInstanceFactory.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
このエラーの最も奇妙な部分は、メモリが使用されていないことです。Xmxを3500mに設定しましたが、メモリ使用量が2.3GBを超えることはありません。
私は考えられる原因を探していて、これを見つけました: RedHatLinuxでのJavaシングルプロセススレッドの制限が低い
そこで、ulimit-nとulimit-uを80000に変更しましたが、それでも何も変更されません。
次に、/ etc / security/limits.confを編集しました
* soft nproc 81920
* hard nproc 81920
* soft nofile 81920
* hard nofile 81920
/etc/sysctl.confも編集しました
fs.file-max = 100000
その後、再起動しました。
また、setenv.shに-Xms=2gを追加しました
-Xssを-Xss5000kに増やしました
echo200000を実行します>/proc / sys / kernel / threads-max
しかし、同じエラーが発生します。何か案は ?
起動開始時のfree-m
total used free shared buffers cached
Mem: 3963 1027 2935 0 25 748
-/+ buffers/cache: 253 3709
Swap: 2047 18 2029
クラッシュ直前のfree-m
total used free shared buffers cached
Mem: 3963 2897 1065 0 31 823
-/+ buffers/cache: 2043 1920
Swap: 2047 18 2029
更新:私も8GBのRAMを搭載したマシンで試しましたが、同じ結果が表示されます。