Giter Site home page Giter Site logo

Comments (3)

marcboeker avatar marcboeker commented on July 24, 2024

Hi @goober
thanks for bringing this up and also providing a repo with code to reproduce this. I haven't had the time to look into it, but two things that come into my mind.

  1. In the beginning of writing this driver I have encountered a similar behaviour and thought, that there is a memory leak. It has turned out, that Go is very greedy about memory and the GC only releases it once he has to as other resources are requesting the memory. This could take some time. Have you tried to close the DB connection and wait for some time afterwards (while the program is still running) and observe the memory usage? Maybe the memory will be freed after some period of time.

  2. Have you tried to run your queries using the Python DuckDB driver and compared it to go-duckdb? Maybe this is not a memory leak on the Go/CGO side but more in the DuckDB or Parquet part?

Once I have more time, I'll dig deeper into it.

from go-duckdb.

goober avatar goober commented on July 24, 2024

I have updated the repo with a second application based on Python that should process the parquet file in the same way as the golang application. Even though it does not release all memory that I would have expected, it releases something as you can see in the image:
image

I have also let the golang application run for a while to see if any memory is released, but unfortunately it keeps the memory at the same level.

I saw that another issue, that could be related, has been opened against the duckdb repository recently but in their case it was a NodeJs based application. I add it here for reference as well. duckdb/duckdb#6607

from go-duckdb.

goober avatar goober commented on July 24, 2024

@marcboeker I have found some memory leaks when the result is being processed in chunks. See linked PR #83 for a fix.

from go-duckdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.