Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9102513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:24:12+00:00 2026-06-17T01:24:12+00:00

Question How can you read files > 1.1 GB into memory under node.js? Example

  • 0

Question

How can you read files > 1.1 GB into memory under node.js?

Example

I’m trying to use topojson under node.js to convert > 1.1 GB GeoJSON files to TopoJSON format.

$ topojson -o outfile.json larger_than_one_point_one_GB_input_file.json

(the above has worked for files up to 517 MB)

Results in the following error

buffer.js:242
this.parent = new SlowBuffer(this.length);
                    ^
RangeError: length > kMaxLength
    at new Buffer (buffer.js:242:21)
    at Object.fs.readFileSync (fs.js:200:14)
    at /usr/local/share/npm/lib/node_modules/topojson/bin/topojson:61:26
    at Array.forEach (native)
    at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/topojson/bin/topojson:60:8)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)

What I’ve Tried so Far

  • Extensive searching
  • Command line memory settings
    • --max-stack-size=2147000000
    • --max_executable_size=2000
    • --max_new_space_size=2097152
    • --max_old_space_size=2097152
  • Custom compile most recent v8 version into custom node.js install
    • They appear to have removed this memory limit (if I’m correct, I may not be)
    • This was not successful

Versions

  • node.js: v0.8.15
  • v8: 3.11.10.25
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:24:14+00:00Added an answer on June 17, 2026 at 1:24 am

    The problem is because topojson uses fs.readFileSync to read the entire file. What that does is open a buffer of size (length of file), then fill it up. But node buffers have a maximum size of 0x3FFFFFFF bytes, or 1GB - 1 byte. So you get that exception.

    Solution? Open the topojson source and replace readFileSync with streaming methods which wouldn’t read the entire file as one block. Or if you’re feeling really hackish, maybe recompile node with a larger kMaxLength constant…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I read (and put into new variable) data stored at specific memory
You can read this question where I ask about the best architecture for a
Question #3 for the day. I've got to design a program that can read
I've read this question, but I want to know how can I delete the
How can you instantiate a Bimap of Google-collections? I've read the question Java: Instantiate
I have a list of files, which need to be read, in chunks, into
I'm currently trying to read the contents of an XML file into a Map
I've read through other questions but to no avail - I really can't work
Question Can I style just a part of a single character? Meaning CSS attributes
Short Question: Can I specify wildcards for custom console folding? If so, what is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.