当前位置: 首页 > 知识库问答 >
问题:

试图启动Minecraft mod时出现未知问题(可能是内存)

杭胜
2023-03-14

我正在开发一个Minecraft mod,我对Java非常缺乏经验。当我试图从Eclipse启动mod时,我得到以下错误:

---- Minecraft Crash Report ----

Time: 6/19/17 5:20 PM
Description: Registering texture

java.lang.OutOfMemoryError: Java heap space
    at     net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageSubImpl(TextureUtil.java:239)
at net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageSub(TextureUtil.java:230)
at net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageAllocate(TextureUtil.java:198)
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:57)
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:67)
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:42)
at net.minecraft.client.renderer.RenderGlobal.<init>(RenderGlobal.java:176)
at net.minecraft.client.Minecraft.init(Minecraft.java:555)
at net.minecraft.client.Minecraft.run(Minecraft.java:387)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head --
Thread: Client thread
Stacktrace:
    at net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageSubImpl(TextureUtil.java:239)
at net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageSub(TextureUtil.java:230)
at net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageAllocate(TextureUtil.java:198)
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:57)

Resource location being registered
Details:
Resource location: minecraft:textures/misc/forcefield.png
Texture object class: net.minecraft.client.renderer.texture.SimpleTexture
Stacktrace:
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:67)
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:42)
at net.minecraft.client.renderer.RenderGlobal.<init>(RenderGlobal.java:176)
at net.minecraft.client.Minecraft.init(Minecraft.java:555)

Initialization
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:387)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)

System Details
Details:
Minecraft Version: 1.11.2
Operating System: Mac OS X (x86_64) version 10.10
Java Version: 1.6.0_65, Apple Inc.
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
Memory: 6342424 bytes (6 MB) / 129957888 bytes (123 MB) up to 129957888 bytes (123 MB)
JVM Flags: 0 total; 
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.38 Powered by Forge 13.20.0.2228 4 mods loaded, 4 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCH minecraft{1.11.2} [Minecraft] (minecraft.jar) 
UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2228.jar) 
UCH forge{13.20.0.2228} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2228.jar) 
Loaded coremods (and transformers): 
Launched Version: 1.11.2
LWJGL: 2.9.2
OpenGL: Intel HD Graphics 5000 OpenGL Engine GL version 2.1 INTEL-10.0.86, Intel Inc.
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because ARB_framebuffer_object is supported     and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: 
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 4x Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz

国防部只是简单地添加了一个未设置的项目,但在我添加之前,它给了我同样的错误。

我在Eclipse中也遇到了这个错误,这让我怀疑这个问题与内存有关:

AL lib: (EE) alc_cleanup: 1 device not closed

感谢您的帮助。

共有1个答案

谭健柏
2023-03-14

JVM内存不足。不管你付出多少,都是不够的。你需要增加它。

注意:此修复程序指定为JVM分配3GB内存,这意味着您的计算机至少需要3GB以上的操作系统内存,因此总共需要4GB或更多内存。

要解决这个问题,请进入JVM参数设置,并将其复制并粘贴到其中:

-Xmx3G -Xms3G -Xmn768m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+CMSParallelRemarkEnabled -XX:MaxTenuringThreshold=15 -XX:MaxGCPauseMillis=30 -XX:GCPauseIntervalMillis=150 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts -XX:ReservedCodeCacheSize=2048m -XX:+UseCodeCacheFlushing -XX:SoftRefLRUPolicyMSPerMB=10000 -XX:ParallelGCThreads=10

-Xmx3G标志表示JVM获得的最大值。在本例中为3GB。如果JVM再次耗尽内存,您可以进一步增加该值(尽管您仍然受到物理可用量的限制)。

-Xms3G标志表示JVM从多少开始。在这种情况下,还需要3GB。

其余的标志处理优化垃圾收集,这些设置是为Minecraft调整的,摆弄它们实际上可能会让事情变得更糟。

 类似资料:
  • “必须有Java运行时环境或Java开发工具包才能运行Sprintoolsuite4。在搜索以下位置后,未找到Java虚拟机:C:\users\admin\desktop\sts-4.7.0.在当前路径中release\jre\bin\javaw.exejavaw.exe” 有人能帮忙吗?我试图寻找一个简单的解决方案,并在STS-4.7.0发布文件中创建了自己的“JRE”文件,并将Java“bin

  • 问题内容: 我有一个Java 1.6桌面应用程序,它是从Windows XP上的批处理文件以javaw开头的。此批处理文件有一个.lnk链接,该链接放置在Windows Startup文件夹中,以便在每次系统启动时启动此应用程序。该应用程序使用SystemTray类在运行时在系统托盘上显示图标。手动启动此应用程序没有问题。如果它是由Windows启动过程启动的,则不会显示任何图标(甚至没有空白图标

  • 我遇到一个项目,ts 未发现某个值可能为空,如上图。正常情况应该如下图。有谁知道可能是哪里出了问题?

  • 我们正在CentOS7上使用安装4j版本6.1.4(构建6320)。 我们为OSX构建了安装程序,安装程序类型为“MacOSX文件夹”。安装程序有一个启动器,用于启动自定义Java SystemTray应用程序。 在安装过程中,启动器按预期执行,并显示SystemTray应用程序。即使在安装过程完成之后,启动器仍然保留在应用程序文档中,并且没有关闭。在系统托盘应用程序关闭之前,此启动器不会从应用程

  • 我有以下视图树: 堆栈视图< br> -轴:垂直< br> -对齐:填充< br> -分布:填充< br> -间距:0 -约束:< br> - -尾随空格到:超级视图< br> - -前导空格到:超级视图< br> - -顶部空格到:超级视图< br> - -子视图:< br> - - ui VIEW(name:VIEW _ ONE)< br > --约束:< br > --高度:60 - - -

  • 上周,我已经很好地安装了我的nginx服务器,直到我注意到我收到了针对它的DOSS攻击。然后我注意到此时我的Nginx服务器无法启动。我尝试了所有其他方法,除了阅读没有帮助的文档之外,我不确定如何解决这个问题。 关于Nginx的文档 主nginx。conf似乎为空,由于某种原因,我无法保存到它。 root@ubuntu-vpc-do-moon:~# /etc/init.d/nginx状态●ngin