The memory limit defined by SET memory_limit is not maintained during huge CSV import #9264
-
|
Hello everyone, I would like to ask a question about the memory_limit configuration parameter. Our datalab environment is a shared environment with a lot of available disk space but with far less available RAM given the high number of users who are often connected at the same time. As a result, optimizing programs to consume the least possible amount of RAM on the server is an obvious rule reminded regularly by the administrators of the environment. As a matter of fact, one of the reasons I chose DuckDB was precisely this limit imposed by However, this week I had multiple bad experiences while importing huge CSV files in DuckDB that made me doubtful about memory_limit and to wonder somewhat its true capacity of memory usage control. Description of my environment: Here is my program written in Python: As you can see in the above program, I defined both Today, I noticed that there is a new version of DuckDB: 0.9.0 (it seems that its R version is not yet available). Using this newer version I managed to reduce significantly the memory exceeds, but still it can happen (5 or 6 GB higher than the limit defined via Consequently, I would like to ask
Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @parvizfarnia, indeed, the CSV Scanner is not yet fully memory managed, hence can't follow strict memory limits. As you realized, 0.9 is already much better than 0.8 because memory management was introduced into the sniffer. However, it still needs to be done in the parser. The plan is that this will come in the next major release. |
Beta Was this translation helpful? Give feedback.
Hi @parvizfarnia, indeed, the CSV Scanner is not yet fully memory managed, hence can't follow strict memory limits. As you realized, 0.9 is already much better than 0.8 because memory management was introduced into the sniffer. However, it still needs to be done in the parser. The plan is that this will come in the next major release.