Skip to content

SNOW-1747415 SNOW-1215393: Out of Memory Issue in memory-limited environment while streaming data #790

Open
@kartikgupta2607

Description

@kartikgupta2607

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of NodeJS driver are you using? ->snowflake-sdk -> Tried with 1.6.20, 1.9.3

  2. What operating system and processor architecture are you using? -> macOS 14.3.1, arm64

  3. What version of NodeJS are you using? -> v18.12.1

  4. What are the component versions in the environment (npm list)? -> NA

  5. Server version: -> 8.9.1

  6. What did you do?
    Tried running this (snowflake_OOM.txt) script to export records from SNOWFLAKE_SAMPLE_DATA.TPCH_SF1000.CUSTOMER table, after limiting max-old-space-size=150 while running the script. A simple SELECT * FROM CUSTOMER; was used, but the node process exited after exporting some rows (200000) with FATAL 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 the streamResult option in the connection config and while executing the query, tried degrading to 1.6.20.
    Following is the metadata of the source table

image As it doesn't have any VARIANT type column, so #536 and the related issues because of it shouldn't matter in our case
  1. 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

  2. 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'
});
  1. What is your Snowflake account identifier, if any? (Optional)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

backend changes neededChange must be implemented on the Snowflake service, and not in the client driver.bugSomething isn't workingstatus-blockedProgress cannot be made to this issue due to an outside blocking factor.status-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions