How to run a benchmark with SecurityManager?
Weijun Wang
weijun.wang at oracle.com
Tue Jan 27 15:50:56 UTC 2015
Yes, it works. See my push at
http://sca00bkv.us.oracle.com:8000/jdk9/secperf/jdk/rev/603dd9f84399212a7d48fc3d7589d98e85dec820.
But the worst thing now is that system properties must be provided on
the command line and it means we cannot run multiple benchmark methods
in one command. (Suppose the other methods must run without a security
manager).
--Max
On 1/27/2015 20:53, Sean Mullan wrote:
> Have you tried granting the permissions that jmh needs in your policy file?
>
> --Sean
>
> 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 -Djava.security.manager 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