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

Reuse of buffers while reading stream and skipping stream

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.5
    • Component/s: Archivers
    • Labels:

      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              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