# 【问题记录】JAVA进程启动大概率卡住6分钟左右，应用日志没有任何WARN ERROR，系统日志也没有发现和进程相关日志，最后定位TOMCAT SHA1PRNG耗时太长

[18-12-19 21:01:13:222][INFO ][org.apache.catalina.util.SessionIdGeneratorBase][localhost-startStop-1]Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [99,677] milliseconds.

-Djava.security.egd=file:/dev/./urandom

Tomcat 7+ heavily relies on SecureRandom class to provide random values for its session ids and in other places. Depending on your JRE it can cause delays during startup if entropy source that is used to initialize SecureRandom is short of entropy. You will see warning in the logs when this happens.

There is a way to configure JRE to use a non-blocking entropy source by setting the following system property: -Djava.security.egd=file:/dev/./urandom

/dev/random可生成高随机性的公钥或一次性密码本。

/dev/urandom则是一个非阻塞的发生器:

dev/random的一个副本是/dev/urandom （”unlocked”，非阻塞的随机数发生器），它会重复使用熵池中的数据以产生伪随机数据。

https://bugs.openjdk.java.net/browse/JDK-6202721