Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-172

Reuse of buffers while reading stream and skipping stream

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3
    • 1.5
    • Archivers

    Description

      When reading a tar archive from a stream for each record a new buffer is allocated. This will cause many new objects that later get collected by the garbage collector. The same issue exists when we are skipping entries. Instead of allocating new buffers we could reuse one single buffer. This saves some GC overhead as well as the time needed to allocate new memory. I created a small patch fixing this issue. I did not test this patch thoughtfully, but it should not cause any trouble, as the buffers never leave their respective classes.

      Attachments

        1. tarbuffer.patch
          1 kB
          Thomas Mair

        Activity

          People

            Unassigned Unassigned
            ladi Thomas Mair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified