Java Keystore.getKey() slow while Key store size Increase

淺唱寂寞╮ 提交于 2019-12-02 03:50:13

I have been facing the same issue related to execution speed varies with different operation system platform.

Jvm loads key store in memory. And its having hashtable collection as internal storage.

Hashtable is synchronized.

Whenever you perform get operation from key store, than it will return it from in-memory key store not from physical keystore. You can confirm it by using ("top" - %wa section) command in linux base OS.

Key store is using hashtable and it is the root cause behind performance decriment.

I have solved this issue by loading all keys from keystore into ConcurrentHashMap while initializing the project. and later on, All the read operation will be performed from MAP instead of keystore. And make sure that all write operation will be perform on both keystore and MAP.

We have faced this issue when we were using safenet jar file as a key store provider, when I removed safenet as a provider & used default providers of java then I didn't face any performance related issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!