开发者

Java availableProcessors() in a Solaris Container

I'm using a Solaris Container with 2 cores (the physical machine has 32 with 8 threads, each one) to run a jvm (BEA Jrockit).

The surprise is: Runtime.getRuntime().availableProcessors() returns 256 rather than 2 or, say 16. That is, the开发者_高级运维 application (a sealed product) believe in 256 cores available, what may cause performance issues.

Are the any way to limit the number of cores a Solaris Container can see, or pass to JRockit (or even Sun Hotspot)?


You can use:

# poolcfg -c 'create pset zone_pset ( uint pset.min=2; uint pset.max=15 )'
# poolcfg -c 'create pool zone_pool'
# poolcfg -c 'associate pool zone_pool ( pset zone_pset )'
# poolcfg -c 'modify pool zone_pool ( string pool.scheduler="FSS" )'
# pooladm -c

to specify between 2 and 15 cores in your container. Read more here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜