I am running a Java application and received this message:
Exception in thread "main" java.lang.OutOfMemoryError: Cannot allocate new BytePointer(1200): totalBytes = 3G, physicalBytes = 7G
at org.bytedeco.javacpp.BytePointer.<init>(BytePointer.java:103)
at org.nd4j.compression.impl.NoOp.compressPointer(NoOp.java:73)
at org.nd4j.compression.impl.AbstractCompressor.compress(AbstractCompressor.java:131)
at org.nd4j.compression.impl.AbstractCompressor.compress(AbstractCompressor.java:103)
at org.nd4j.storage.CompressedRamStorage.store(CompressedRamStorage.java:68)
at org.deeplearning4j.models.embeddings.loader.WordVectorSerializer.loadStaticModel(WordVectorSerializer.java:2638)
at com.dl.SentimentClassifier.main(SentimentClassifier.java:76)
Caused by: java.lang.OutOfMemoryError: Physical memory usage is too high: physicalBytes = 7G > maxPhysicalBytes = 7G
at org.bytedeco.javacpp.Pointer.deallocator(Pointer.java:572)
at org.bytedeco.javacpp.Pointer.init(Pointer.java:121)
at org.bytedeco.javacpp.BytePointer.allocateArray(Native Method)
at org.bytedeco.javacpp.BytePointer.<init>(BytePointer.java:95)
My Windows laptop has 16G memory and I am setting the Java heap size in Intellij as:
-Xms128m
-Xmx10G
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
What does the message mean? I am thinking it says the Java application needs 7G memory, and my heap setting is > 7G. If that is the case, why it sends a OutofMemory error?