Does Java Security Manager decrease performance?
Asked Answered
P

2

2

Does implementing the Java Security Manager result in decreased performance?

Pelage answered 7/9, 2010 at 6:46 Comment(0)
G
7

That depends entirely on the details of the implementation, and on the application.

It's certainly possible to implement a Security Manager that takes a long time to check certain permissions and an application that requires these premissions to be checked very frequently, resulting in horrible performance.

But typically, checking permissions does not happen often enough to cause significant performance decreases.

Gazebo answered 7/9, 2010 at 6:55 Comment(2)
Thank you very much for the answer! Also I have one more question: Does the security manager check only the potentially harmful APIs like System.exit() or does it check all the APIs like System.out.println() ?Pelage
@instantsetsuna: The security manager is called explicitly by specific "potentially unsafe" API calls, i.e. it does not check every single method call. You can add security checks in your own code as well.Gazebo
D
0

In real use case scenario, Content written within Java.policy file is handled by Java security Manager. It is always suggested to start the policy file with the blank one and in case of security exception add the necessary permissions. Repeat the process until you have minimal set of permissions to run the application. This will let you to avoid unnecessary permission check which definitely helps to improve performance.

Daiseydaisi answered 8/3, 2020 at 7:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.