Hard-link large files in build directories

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: infrastructure
    • None

      Following up on JDK-8374507, I noticed our build footprint is dominated by debug info files (and likely embedded to libjvm.so as well):

      $ find build/linux-x86_64-server-fastdebug/ -type f -size +100M -printf "%s %p\n" | sort -n -r
      1139416728 build/linux-x86_64-server-fastdebug/images/test/hotspot/gtest/server/libjvm.so
      1139416728 build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/gtest/libjvm.so
      994724125 build/linux-x86_64-server-fastdebug/support/interim-jmods/java.base.jmod
      901019768 build/linux-x86_64-server-fastdebug/support/modules_libs/java.base/server/libjvm.debuginfo
      901019768 build/linux-x86_64-server-fastdebug/support/interim-image/lib/server/libjvm.debuginfo
      901019768 build/linux-x86_64-server-fastdebug/images/symbols/lib/server/libjvm.debuginfo
      901019768 build/linux-x86_64-server-fastdebug/images/jdk/lib/server/libjvm.debuginfo
      386479540 build/linux-x86_64-server-fastdebug/images/jmods/java.base.jmod
      386479540 build/linux-x86_64-server-fastdebug/images/jdk/jmods/java.base.jmod
      160335628 build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/gtest/objs/precompiled/precompiled.hpp.gch
      160334141 build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/objs/precompiled/precompiled.hpp.gch
      150099701 build/linux-x86_64-server-fastdebug/images/jdk/lib/modules

      Now, at least these files are duplicates:

      $ sha1sum build/linux-x86_64-server-fastdebug/images/test/hotspot/gtest/server/libjvm.so build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/gtest/libjvm.so
      c1187c05479a6535c81bd455c35b18010d80a0a5 build/linux-x86_64-server-fastdebug/images/test/hotspot/gtest/server/libjvm.so
      c1187c05479a6535c81bd455c35b18010d80a0a5 build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/gtest/libjvm.so

      $ sha1sum build/linux-x86_64-server-fastdebug/support/modules_libs/java.base/server/libjvm.debuginfo build/linux-x86_64-server-fastdebug/support/interim-image/lib/server/libjvm.debuginfo build/linux-x86_64-server-fastdebug/images/symbols/lib/server/libjvm.debuginfo build/linux-x86_64-server-fastdebug/images/jdk/lib/server/libjvm.debuginfo
      17fc72ce8a89c2de1fd64f993def4451af2b9c84 build/linux-x86_64-server-fastdebug/support/modules_libs/java.base/server/libjvm.debuginfo
      17fc72ce8a89c2de1fd64f993def4451af2b9c84 build/linux-x86_64-server-fastdebug/support/interim-image/lib/server/libjvm.debuginfo
      17fc72ce8a89c2de1fd64f993def4451af2b9c84 build/linux-x86_64-server-fastdebug/images/symbols/lib/server/libjvm.debuginfo
      17fc72ce8a89c2de1fd64f993def4451af2b9c84 build/linux-x86_64-server-fastdebug/images/jdk/lib/server/libjvm.debuginfo


      If we manage to hard-link them instead of copying, we could save about 4G out of 16G of build footprint.

            Assignee:
            Unassigned
            Reporter:
            Aleksey Shipilev
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: