Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6611629

Avoid hardcoded cygwin paths for memory detection

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • infrastructure
    • b25
    • generic
    • generic, windows
    • Not verified

        JDK build process relies on information about size of RAM to enable batch processing on Windows.
        However, autodetection process assumes cygwin is present in the c:\cygwin and has free utility installed.
        This is not the case rather often and compilation is performed assuming 512MB RAM size.

        Autodetection logic should support MKS (which has sysinf tool to get memory size) and
        cygwin installations to other directories.
        Perhaps autodetection logic can even use windows utilities (such as mem or systeminfo).
        mem tool is not very accurate and splits available memory into chunks according to DOS rules
        but from further usage of RAM estimate it seems that very accurate measurement is not required.
        The message comes from make/common/shared/Platform.gmk:
          # How much RAM does this machine have:
          MB_OF_MEMORY := $(shell \
            if [ -f "C:/cygwin/bin/free.exe" ] ; then \
              ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \
        grep Mem: | \
        sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \
            else \
              echo "512"; \
            fi)

        The call to free.exe causes a message such as this on some windows machines
        but not others:
           Unknown HZ value! (500) Assume 100.

        The '500' varies depending on if the make is done under cygwin or MKS.

              ohair Kelly Ohair (Inactive)
              igor Igor Nekrestyanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: