You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know how it happened, and if it is my own fault or just another bug.
Exception in thread "main" java.lang.OutOfMemoryError: Out of stack space.
at org.lwjgl.system.MemoryStack.nmalloc(MemoryStack.java:315)
at org.lwjgl.system.MemoryStack.nASCII(MemoryStack.java:636)
at org.lwjgl.glfw.GLFW.glfwUpdateGamepadMappings(GLFW.java:4225)
at com.xenoamess.cyan_potion.base.GameWindow.initGlfw(GameWindow.java:126)
at com.xenoamess.cyan_potion.base.GameWindow.init(GameWindow.java:71)
at com.xenoamess.cyan_potion.base.GameManager.initGameWindow(GameManager.java:380)
at com.xenoamess.cyan_potion.base.GameManager.startup(GameManager.java:134)
at com.xenoamess.cyan_potion.cyan_potion_demo.ForceEntrance.main(ForceEntrance.java:15)
I'm sure I run glfwUpdateGamepadMappings after glfwinit.
I simply use this to get the text from gamecontrollerdb.txt
LWJGL uses the MemoryStack internally to encode string parameters, but gamecontrollerdb.txt is bigger (162kb) than the default stack size (64kb).
One way to avoid the error is to increase the default stack size with Configuration.STACK_SIZE (or -Dorg.lwjgl.system.stackSize). However, reading the db as a Java string, then serializing it again is wasteful. A better option is to read the file as a ByteBuffer directly and use the glfwUpdateGamepadMappings(ByteBuffer) overload.
I'll also try to make glfwUpdateGamepadMappings(CharSequence) use a heap allocation internally, or maybe remove it completely. Thanks for opening this issue!
I don't know how it happened, and if it is my own fault or just another bug.
Exception in thread "main" java.lang.OutOfMemoryError: Out of stack space.
at org.lwjgl.system.MemoryStack.nmalloc(MemoryStack.java:315)
at org.lwjgl.system.MemoryStack.nASCII(MemoryStack.java:636)
at org.lwjgl.glfw.GLFW.glfwUpdateGamepadMappings(GLFW.java:4225)
at com.xenoamess.cyan_potion.base.GameWindow.initGlfw(GameWindow.java:126)
at com.xenoamess.cyan_potion.base.GameWindow.init(GameWindow.java:71)
at com.xenoamess.cyan_potion.base.GameManager.initGameWindow(GameManager.java:380)
at com.xenoamess.cyan_potion.base.GameManager.startup(GameManager.java:134)
at com.xenoamess.cyan_potion.cyan_potion_demo.ForceEntrance.main(ForceEntrance.java:15)
package com.xenoamess.cyan_potion;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
The text was updated successfully, but these errors were encountered: