Alexey,

Actually I think about next steps to solve problem:

1. Add method IgniteUtils#isCgroupsLimited which will detect JVM inside
container (dockerl, lxc, etc);

2. Call IgniteUtils#isCgroupsLimited inside
GridLocalMetrics#getAvailableProcessors
and detect available CPUs by calling "nproc" in cases when container was
detected;

3. Replace all calls of Runtime#getAvailableProcessors with
GridLocalMetrics#getAvailableProcessors;

What is the reason to create a new utility class like IgniteRuntimeUtils?

On Aug 26, 2016 2:21 PM, "Alexey Kuznetsov" <akuznet...@gridgain.com> wrote:

> Eduard,
>
> I think if it is known bug it should be properly fixed by creating some
> utility class (for example, IgniteRuntimeUtils) that could be used all over
> Ignite code base.
> I do not think it is a good idea to "this #getRuntime calls with using
> GridLocalMetrics".
>
>
> On Fri, Aug 26, 2016 at 5:42 PM, Eduard Yuzlikeev <
> sinhrofazatron...@gmail.com> wrote:
>
> > Hi
> > I want to work on next bug
> > https://issues.apache.org/jira/browse/IGNITE-2092?jql=
> > project%20%3D%20IGNITE%20AND%20labels%20in%20%28newbie%29%
> > 20and%20status%20%3D%20OPEN
> > Can somebody assign me on it?
> >
> > I've investigated this issue and looks like this bug is on JVM side and
> > OpenJDK community fixed it only in Java 9 [1].
> > It's can be fixed fast inside GridLocalMetrics#getAvailableProcessors
> but
> > looks like other modules don't use it and detect available CPUs by
> calling
> > Runtime.getRuntime().*availableProcessors* [2].
> > Should I also replace this #getRuntime calls with using GridLocalMetrics?
> >
> > [1] https://bugs.openjdk.java.net/browse/JDK-8140793
> > [2]
> > https://github.com/apache/ignite/search?p=4&q=
> > availableProcessors&type=Code&utf8=%E2%9C%93
> > --
> > Best regards, Eduard Y.
> >
>
>
>
> --
> Alexey Kuznetsov
> GridGain Systems
> www.gridgain.com
>

Reply via email to