golang / snappy

The Snappy compression format in the Go programming language.
BSD 3-Clause "New" or "Revised" License
1.52k stars 163 forks source link

How to decompress a 2GB file on a machine with only 1GB of RAM #57

Closed Kuri-su closed 1 year ago

Kuri-su commented 3 years ago

I saw all example used this code

    rawContent, err := ioutil.ReadFile(localSnappyFilePath)
    if err != nil {
        return err
    }

    content, err := snappy.Decode(nil, rawContent)
    if err != nil {
        return err
    }

but my VM just 1 GB RAM, and the files size is 2GB, i can't read it all into memory

thanks your hard work and your patience :pray: