Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-5933

PCollectionViews$SimplePCollectionView.hashCode allocates memory

Details

    • Improvement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 2.8.0
    • 2.9.0
    • sdk-java-core

    Description

      I'm currently profiling memory consumption of our Beam pipeline and have noticed that

          org.apache.beam.sdk.values.PCollectionViews$SimplePCollectionView.hashCode()

      makes noticeable heap allocations. The implementation is:

          return Objects.hash(tag);

      That itself translates to:

          return Arrays.hashCode(values);

      Which performs implicit array creation in order to call:

          public static int Arrays.hashCode(Object a[]);

      Instead of the helper call, doing simple:

          tag.hashCode();

      Seems more appropriate.

      Attachments

        Issue Links

          Activity

            People

              janotav Vojtech Janota
              janotav Vojtech Janota
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m