Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-16473

[Go] Memory leak in parquet page reading

    XMLWordPrintableJSON

Details

    Description

      package main_test
      
      import (
      	"context"
      	"os"
      	"testing"
      
      	"github.com/apache/arrow/go/v8/arrow/memory"
      	"github.com/apache/arrow/go/v8/parquet"
      	"github.com/apache/arrow/go/v8/parquet/file"
      	"github.com/apache/arrow/go/v8/parquet/pqarrow"
      )
      
      func TestParquetReading(t *testing.T) {
      	ctx := context.Background()
      	mem := memory.NewCheckedAllocator(memory.DefaultAllocator)
      	defer mem.AssertSize(t, 0)
      
      	f, err := os.Open("test.parquet")
      	if err != nil {
      		t.Fatal(err)
      	}
      	defer f.Close()
      
      	pf, err := file.NewParquetReader(
      		f,
      		// Note: use the provided memory allocator
      		file.WithReadProps(parquet.NewReaderProperties(mem)),
      	)
      	if err != nil {
      		t.Fatal(err)
      	}
      	defer pf.Close()
      
      	r, err := pqarrow.NewFileReader(pf, pqarrow.ArrowReadProperties{}, mem)
      	if err != nil {
      		t.Fatal(err)
      	}
      
      	table, err := r.ReadTable(ctx)
      	if err != nil {
      		t.Fatal(err)
      	}
      	defer table.Release()
      }
      

      Attachments

        Issue Links

          Activity

            People

              minyoung Min-Young Wu
              minyoung Min-Young Wu
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 2h 20m
                  2h 20m