title: What to do for memory related exception while working with NLP Stanford?
body: <p>I am trying to run the Class : Word2VecSentimentRNN from the following link:</p>
  
  <p><a href="https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/recurrent/word2vecsentiment/Word2VecSentimentRNN.java" rel="nofollow noreferrer">https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/recurrent/word2vecsentiment/Word2VecSentimentRNN.java</a></p>
  
  <p>The example is big one, hence given link of the example here.<br>
  Also I have downloaded the Sample vector file from the following link:<br>
  <a href="https://github.com/mmihaltz/word2vec-GoogleNews-vectors" rel="nofollow noreferrer">https://github.com/mmihaltz/word2vec-GoogleNews-vectors</a><br>
  I am getting the following error:  </p>
  
  <pre><code>Exception in thread "main" java.lang.OutOfMemoryError: Cannot allocate 3103474 + 3600000000 bytes (&gt; Pointer.maxBytes)
      at org.bytedeco.javacpp.Pointer.deallocator(Pointer.java:484)
      at org.bytedeco.javacpp.Pointer.init(Pointer.java:118)
      at org.bytedeco.javacpp.FloatPointer.allocateArray(Native Method)
      at org.bytedeco.javacpp.FloatPointer.&lt;init&gt;(FloatPointer.java:68)
      at org.nd4j.linalg.api.buffer.BaseDataBuffer.&lt;init&gt;(BaseDataBuffer.java:457)
      at org.nd4j.linalg.api.buffer.FloatBuffer.&lt;init&gt;(FloatBuffer.java:57)
      at org.nd4j.linalg.api.buffer.factory.DefaultDataBufferFactory.createFloat(DefaultDataBufferFactory.java:238)
      at org.nd4j.linalg.factory.Nd4j.createBuffer(Nd4j.java:1201)
      at org.nd4j.linalg.factory.Nd4j.createBuffer(Nd4j.java:1176)
      at org.nd4j.linalg.api.ndarray.BaseNDArray.&lt;init&gt;(BaseNDArray.java:230)
      at org.nd4j.linalg.cpu.nativecpu.NDArray.&lt;init&gt;(NDArray.java:111)
      at org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory.create(CpuNDArrayFactory.java:247)
      at org.nd4j.linalg.factory.Nd4j.create(Nd4j.java:4261)
      at org.nd4j.linalg.factory.Nd4j.create(Nd4j.java:4227)
      at org.nd4j.linalg.factory.Nd4j.create(Nd4j.java:3501)
      at org.deeplearning4j.models.embeddings.loader.WordVectorSerializer.readBinaryModel(WordVectorSerializer.java:219)
      at org.deeplearning4j.models.embeddings.loader.WordVectorSerializer.loadGoogleModel(WordVectorSerializer.java:118)
      at com.nyu.sentimentanalysis.core.Word2VecSentimentRNN.run(Word2VecSentimentRNN.java:77)
  </code></pre>
  
  <p>I have tried to launch the application with the parameters <code>-Xmx2g and -Xms2g</code>. Even changed the values from time to time to check if it helps or work.<br>
  Kindly let me know what should I do. Getting locked up here.</p>