我的记忆力够吗? [英] Is my memory enough?

查看:799
本文介绍了我的记忆力够吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Java应用程序并收到此消息:

 线程main中的异常java.lang.OutOfMemoryError:无法分配新的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。压缩(AbstractCompressor.java:103)
at org.nd4j.storage.CompressedRamStorage.store(CompressedRamStorage.java:68)
at org.deeplearningarning4j.models.embeddings.loader.WordVectorSerializer.loadStaticModel(WordVectorSerializer。 java:2638)
at com.dl.SentimentClassifier.main(SentimentClassifier.java:76)
引起:java.lang.OutOfMemoryError:物理内存使用率过高: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)

我的Windows笔记本电脑有16G内存,我将Intellij中的Java堆大小设置为:

  -Xms128m 
-Xmx10G
-XX:ReservedCodeCacheSize = 240m
-XX:+ UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB = 50
- ea
-Dsun.io.useCanonCaches = false
-Djava.net.preferIPv4Stack = true
-XX:+ HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

该消息是什么意思?我在想它说Java应用程序需要7G内存,而我的堆设置大于7G。如果是这种情况,为什么它会发送OutofMemory错误?

解决方案

您正在混合IntelliJ IDEA JVM选项和指定的VM选项对于从IntelliJ IDEA开始的应用程序。



您的问题中的剪辑是IntelliJ IDEA的 .vmoptions 文件并且它应用于运行IntelliJ IDEA本身的JVM。



您自己的应用程序在一个单独的JVM中运行,该JVM不继承IntelliJ IDEA JVM的VM选项。



可以在相应的


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?

解决方案

You are mixing up IntelliJ IDEA JVM options and VM options specified for the apps you start from IntelliJ IDEA.

The snipped in your question is the .vmoptions file for IntelliJ IDEA and it's applied to the JVM that runs IntelliJ IDEA itself.

Your own apps run in a separate JVM that doesn't inherit the VM options of IntelliJ IDEA JVM.

JVM settings for the app can be adjusted in the corresponding Run/Debug configuration, VM options field.

这篇关于我的记忆力够吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆