title: Reading excel file with encoding of "UTF-8" using xlsx package, GC overhead limit exceeded, read operation running for a long time without stopping
body: <p>I need to read an excel file of  size, 56000 rows and 16 columns.t The file must be read with UTF-8 encoding as it has chinese characters in it. I am using read.xlsx function from the xlsx package.</p>
  
  <pre><code>logdata_new= read.xlsx(paste0(path,file.log),1,encoding="UTF-8",stringsAsFactors=FALSE)
  </code></pre>
  
  <p>I am getting the below error when running this code.</p>
  
  <pre><code>java.lang.OutOfMemoryError: GC overhead limit exceeded
  </code></pre>
  
  <p>So I increased the java.parameters to a higher size as the default was 512mb</p>
  
  <pre><code>options(java.parameters = "- Xmx8000m")
  </code></pre>
  
  <p>As I have a system with 16gb RAM, I allocated 8 gb. However the read operation has been running for more than 15 hours and is showing no signs of stopping. Will allocating more RAM slow down the read process?</p>
  
  <p>I am also running parallely the same command with java parameters set to 1gb.
  I have also used read.xlsx from openxlsx package which reads the data fast but with no encoding. I need UTF-8 encoding as chinese characters are involved in the data.</p>
  
  <p>And read.xlsx2 command gives me the error.</p>
  
  <pre><code>Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :   cannot coerce class ""Sparte"" to a data.frame
  </code></pre>
  
  <p>Is there a way to read a large excel file with UTF-8 encoding in lesser time? </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The reaading of the excel file has been completed. It just needed 18 hours.</p>