即使在java 8中,SecureRandom的创建也很慢 [英] Creation of SecureRandom is slow, even in java 8
问题描述
我搜索了这个问题。我得到了印象,它在java 8中解决了。但突然之间,我开始在我的新VM中基于ubuntu 14.04解决这个问题。
I searched on this problem. I got impression, it is resolved in java 8. But suddenly, I started getting this problem in my new VM, based of ubuntu 14.04.
2015-07-27 14:56:35.324 INFO 11809 --- [localhost-startStop-1] oacutil.SessionIdGeneratorBase:Creation使用[SHA1PRNG]生成会话ID的SecureRandom实例花了[167,833]毫秒。
2015-07-27 14:56:35.324 INFO 11809 --- [localhost-startStop-1] o.a.c.util.SessionIdGeneratorBase : Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [167,833] milliseconds.
并且java版本是
java -version
java version1.8.0_45
Java(TM)SE运行时环境(版本1.8.0_45-b14)
Java HotSpot(TM)64位服务器VM(版本25.45-b02,混合模式)
java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
服务器是ubuntu 14.04。
Server is ubuntu 14.04.
另一件事是,我将这个java进程作为spring boot应用程序运行,它已经嵌入了tomcat运行。
Another thing is, i running this java process as spring boot application, which has embedded tomcat running.
任何想法,可能出错?
我甚至尝试过,
Any ideas, what could be wrong? I even tried,
-Djava.security.egd = file:/ dev /./ urandom 选项
推荐答案
运行时尝试使用以下命令
Try using the following command while running
java -Djava.security.egd = file:/ dev /./ urandom -jar demo.jar
java -Djava.security.egd=file:/dev/./urandom -jar demo.jar
这篇关于即使在java 8中,SecureRandom的创建也很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!