Cygwin - awk-Cannot allocate memory -


while using cygwin ( cygwin_nt-6.1 ), compare 2 files (file11.csv : 25.82 mn rows, file22.csv : 4.1 mn) ,

executing command awk -f "," 'nr==fnr{a[$2]=$0;next }{print (a[$1]?a[$1]:"notfound,notfound") "," $0}' file11.csv file22.csv>op_file33.csv 

i getting error :

awk: cmd. line:1: (filename=- fnr= fatal: more_nodes: nextfree: can't allocate 4000 bytes of memory (cannot allocate memory), 

. error file (gawk.exe.stackdump) contains:stack trace: frame function args 002299a0 7710f003 (00000118, 0000ea60, 00000000, 00229ad4) 002299b4 7710efb2 (00000118, 0000ea60, 000000a4, 00229ab0) 00229ad4 610dbe29 (00000000, 00000000, 00229ad0, 00229bc4) 00229bc4 610d915e (00000000, 61102fa2, 003b0023, 00230000) 00229c24 610d962e (20000038, 00000000, 00229c64, 00000006) 00229cd4 610d9780 (00000500, 00000006, 00229d04, 0022ce64) 00229cf4 610d97ac (00000006, 0022ce80, 0022ce64, 0042da60) 00229d24 610d9a85 (0044f0f4, 00000503, 00000000, 00000000) 00229d44 0042b773 (00000004, 00000001, 00229e64, 6103118a) 00229d54 691013b2 (0000000b, 00229db8, 00000000, 00000000) 00229e64 6103118a (00000118, 0000ea60, 000000a4, 00229f60) 00229f84 610dbee2 (00000004, 0022a060, 0000001c, 00000000) 0022a094 610314f0 (0022a180, 0022ff14, 0022a19c, 0022a154) 0022a0b8 77ae65f9 (0022a180, 0022ff14, 0022a19c, 0022a154) 0022a168 77ae65cb (0022a180, 0022a19c, 0022a180, 0022a19c) 0022a498 77ae6457 (00000000, 00000000, 0022a4dc, 77af3b27) end of stack trace (more stack frames may present)

you're storing larger file (file11.csv = 25m lines) in memory rather smaller file (file22.csv = 4m lines).

just change logic store file22 , compare lines in file11 read them you'll fine.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -