How to run a benchmark with SecurityManager?

Sean Mullan sean.mullan at
Tue Jan 27 12:53:48 UTC 2015

Have you tried granting the permissions that jmh needs in your policy file?


On 01/27/2015 05:52 AM, Wang Weijun wrote:
> Hi All
> I'm trying to benchmark a method that works differently when a SecurityManager is on (and with different policy files). I've tried adding on the command line or calling System.setSecurityManager(new SecurityManager()) inside a @Setup method, but seems jmh itself cannot run correctly (because it needs reflection and thread group manipulation).
> Is there anyway to do it? Since JM itself and the benchmark is compiled into one jar, I cannot grant AllPermission to jmh and less permission on my own code.
> Thanks
> Max

More information about the jmh-dev mailing list