while importing data from csv to postgres ,getting java.lang.OutOfMemoryError: GC overhead limit exceeded
<p>I am trying to import data from CSV file to postgres database,but while importing I am getting below error </p>

<pre><code>ERROR - Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
ERROR -  at java.nio.CharBuffer.wrap(CharBuffer.java:466)
ERROR -  at java.nio.CharBuffer.wrap(CharBuffer.java:487)
ERROR -  at org.postgresql.core.Utils.encodeUTF8(Utils.java:65)
ERROR -  at org.postgresql.core.v3.SimpleParameterList.getV3Length(SimpleParameterList.java:266)
ERROR -  at org.postgresql.core.v3.QueryExecutorImpl.sendBind(QueryExecutorImpl.java:1275)
ERROR -  at org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1547)
ERROR -  at org.postgresql.core.v3.QueryExecutorImpl.sendQuery(QueryExecutorImpl.java:1098)
ERROR -  at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:398)
ERROR -  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2754)
</code></pre>

<p>I am running this from 16GB ram and 8 core m/c and no other processes are running, but still getting this error. 
Is this because of encoding .</p>

<p>Please help</p>