Reputation: 21
We are trying to compare 2 CSV files which are of 3 gb size. We are receiving java heap memory error while trying to read these files with CSV map reader.can anybody please help me to solve this issue.
Upvotes: 1
Views: 838
Reputation: 185
One option is to expand the memory for the heap. The initial heap size is 128 megs by default. Java has a flag you can pass it to increase this value.
You can initialize the heap size with -Xms[size] or you can give the JVM a maximum heap size with -Xmx[size].
In your case I would use -Xms to give the program more memory. For instance if you want the heap size to start out at 512 MB then when running the program you would run:
java -Xms512m programName
Upvotes: 1