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

时间:2017-06-19 22:06:07

标签: minecraft minecraft-forge

我正在开发一个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

mod只是添加了一个无纹理的项目,但在我添加之前它给了我同样的错误。

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

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

感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

JVM内存不足。无论你付出多少,它还不够。你需要增加它。

注意:此修复程序指定将3GB内存分配给JVM,这意味着您的计算机 至少需要 plus 更多的操作系统,总共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进行调整,摆弄它们实际上可能会使事情更糟