[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#717051: gcj-jdk: number of processors reported by Runtime.getRuntime().availableProcessors() is incorrect



Package: gcj-jdk
Version: 4:4.7.2-1
Severity: normal


Number of processors/cores/threads returned by a java program compiled with gcj is incorrect:

folkert@belle:~$ cat numprocs.java
class numprocs {
        public static void main(String [] args) {
                System.out.println("number of processors: " + Runtime.getRuntime().availableProcessors());
        }
}

folkert@belle:~$ gcj --version
gcj (Debian 4.8.1-2) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

folkert@belle:~$ gcj --main=numprocs -o numprocs numprocs.java
folkert@belle:~$ ./numprocs
number of processors: 1

folkert@belle:~$ java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.3) (7u3-2.1.3-1)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

folkert@belle:~$ javac numprocs.java
folkert@belle:~$ java numprocs
number of processors: 12

folkert@belle:~$ grep -c '^processor   *:' /proc/cpuinfo
12


-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.9-1-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcj-jdk depends on:
ii  gcj-4.7-jdk                   4.7.2-3    gcj and classpath development tool
ii  gcj-jre                       4:4.7.2-1  Java runtime environment using GIJ
ii  libgcj-common                 1:4.6.3-8  Java runtime library (common files

gcj-jdk recommends no packages.

gcj-jdk suggests no packages.

-- no debconf information


Reply to: