性能话题>ThreadPriorityPolicy 参数讨论专区>

ThreadPriorityPolicy 参数讨论专区

欢迎来到 JVM 参数ThreadPriorityPolicy的讨论专区

参数名称

ThreadPriorityPolicy

取值类型

int

参数说明

0 : Normal. VM chooses priorities that are appropriate for normal applications. On Solaris NORM_PRIORITY and above are mapped to normal native priority. Java priorities below NORM_PRIORITY map to lower native priority values. On Windows applications are allowed to use higher native priorities. However, with ThreadPriorityPolicy=0, VM will not use the highest possible native priority, THREAD_PRIORITY_TIME_CRITICAL, as it may interfere with system threads. On Linux thread priorities are ignored because the OS does not support static priority in SCHED_OTHER scheduling class which is the only choice for non-root, non-realtime applications. 1 : Aggressive. Java thread priorities map over to the entire range of native thread priorities. Higher Java thread priorities map to higher native thread priorities. This policy should be used with care, as sometimes it can cause performance degradation in the application and/or the entire system. On Linux this policy requires root privilege.

用法及建议

  • 使用该参数的正确姿势是-XX:ThreadPriorityPolicy=___

默认值

平台/版本 JDK6 JDK7 JDK8
Linux 0 0 0
MacOS 0 0 0
Windows 0 0 0

关于该参数的使用,您有什么心得体会或者疑问吗?欢迎在下方参与讨论 ↓

点赞
5964 阅读
请先登录,感受更多精彩内容
快去登录吧,你将获得
  • 浏览更多精彩评论
  • 和开发者讨论交流,共同进步