Description
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
-
What version of NodeJS driver are you using? ->snowflake-sdk -> Tried with 1.6.20, 1.9.3
-
What operating system and processor architecture are you using? -> macOS 14.3.1, arm64
-
What version of NodeJS are you using? -> v18.12.1
-
What are the component versions in the environment (
npm list
)? -> NA -
Server version: -> 8.9.1
-
What did you do?
Tried running this (snowflake_OOM.txt) script to export records fromSNOWFLAKE_SAMPLE_DATA.TPCH_SF1000.CUSTOMER
table, after limiting max-old-space-size=150 while running the script. A simpleSELECT * FROM CUSTOMER;
was used, but the node process exited after exporting some rows (200000) withFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
error but on modifying the same query with a LIMIT clause (with limit of 1,000,000), it was able to export 1M records with the same old-space limit. I tried workarounds mentioned in SNOW-750472 Out of memory issue #43 and the linked issues but none worked. Tried using thestreamResult
option in the connection config and while executing the query, tried degrading to 1.6.20.
Following is the metadata of the source table

-
What did you expect to see?
It should be able to export the same number of records before the OOM issue occurs, also it seems a large buffer is fetched if the LIMIT isn't present in the query as it seems the GC triggers a bit late for query without LIMIT
-
Can you set logging to DEBUG and collect the logs? -> Can't upload logs due to company security policies.
var snowflake = require('snowflake-sdk');
snowflake.configure(
{
logLevel: 'trace'
});
- What is your Snowflake account identifier, if any? (Optional)
Activity