Leaked resources
3TUSK opened this issue ยท 1 comments
Synopsis
Set logging level to DEBUG
reveals that Minecraft claims that Charset is leaking resources.
Reproduction
- Have Charset 0.5.5.7 and Forge 14.23.5.2808 (or above) installed.
- Put
-Dforge.logging.mojang.level=ALL
in JVM arguments, and launch game. - Observe log spam that looks like this: https://paste.ubuntu.com/p/f5Z2DdKxvD/
Analysis
All IResource
(and subsequently InputStream
from it) acquired from IResourceManager.getResource
should be closed. This affects:
- http://git.asie.pl/asie-minecraft/Charset/src/branch/1.12-stable/src/main/java/pl/asie/simplelogic/gates/render/GateRenderDefinitions.java#L161-L199
- http://git.asie.pl/asie-minecraft/Charset/src/branch/1.12-stable/src/main/java/pl/asie/charset/lib/render/sprite/PixelOperationSprite.java#L163-L168
- http://git.asie.pl/asie-minecraft/Charset/src/branch/1.12-stable/src/main/java/pl/asie/charset/lib/resources/ColorPaletteParser.java#L82-L98
See also SlimeKnights/TinkersConstruct#3810.
Apologize in advance, but after I installed Charset 0.5.6.0 I noticed the following in my console output:
[15:36:13] [Finalizer/WARN] [minecraft/FallbackResourceManager]: Leaked resource: 'charset:color_palette.json' loaded from pack: 'FMLFileResourcePack:Charset'
java.lang.Exception
at net.minecraft.client.resources.FallbackResourceManager$InputStreamLeakedResourceLogger.<init>(FallbackResourceManager.java:128)
at net.minecraft.client.resources.FallbackResourceManager.func_177245_a(FallbackResourceManager.java:76)
at net.minecraft.client.resources.FallbackResourceManager.func_135056_b(FallbackResourceManager.java:98)
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_135056_b(SimpleReloadableResourceManager.java:79)
at pl.asie.charset.lib.resources.ColorPaletteParser.onTextureStitchPre(ColorPaletteParser.java:83)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_214_ColorPaletteParser_onTextureStitchPre_Pre.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
at net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(ForgeHooksClient.java:211)
at net.minecraft.client.renderer.texture.TextureMap.func_174943_a(TextureMap.java:87)
at net.minecraftforge.client.model.ModelLoader.func_177570_a(ModelLoader.java:159)
at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:28)
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:513)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)
Do notice that this is the only "leaked resource" warning occurred in my log.