I have to open a very large file ~15GB and trying to read the whole file using fs.readFileSync
and then put the whole file into hashmap based on a key to dedup the file. But then soon I hit the issue that I cant read the whole file into memory because of v8 limit!
I tried to pass the larger memory size using -max-old-space-size
still its not working.
Why is that?
Is this a limitation in nodejs or I am missing something?
I have 64GB RAM in my machine.
For example, there is a large file data.txt with the following format and I have to dedup based on uuid:
new record
field_separator
1fd265da-e5a6-11ea-adc1-0242ac120002 <----uuid
field_separator
Bob
field_separator
32
field_separator
Software Engineer
field_separator
Workday
point_separator
new record
field_separator
5396553e-e5a6-11ea-adc1-0242ac120002
field_separator
Tom
field_separator
27
this is a field3
QA Engineer
field_separator
Synopsis
point_separator
........
There is another small file (200 mega) which contains UUID with different values. I have to lookup with the UUID from the above-mentioned file.
The script is just a one-time processing.