I’m new to java, android and game development and i’m trying to made a simple 3d game to run on android.
All goes well until the app shoot this intermittent exception (various android versions):
com.jme3renderer.RendererException: an opengl error has occurred: out of memory at
All my pictures are 64x64 and my font too…
I think that Nifty may be triggering the error, someone no idea what can be? I’ve tried various solutions, even System.gc () and resetGLObjects () (which correct place to implement these codes?) And so far nothing! The output of the exception can not trace the reason for the problem …
I took the line of the scissor_test, but the exception continues. I tried to comment out the line of the class that calls the user function setcliprect (the setCamera function of RendererManager.java:827) but the exception is thrown elsewhere, does not solve the problem that apparently does not come from jme3 code.
… Memory usage is gradually rising up the locking and quick, about 3 to 4 mb per second. In logcat, something seems to be trying to read 1152 bytes which is available 704 bytes and is forcing a crash. Throughout the run logcat repeats these two lines to reach the exception:
I/MaliBase(26028): WARNING: Reading 1152 bytes at offset 0 from GL stream 2 (HW stream 2) bound to VBO 43. But only 704 bytes available in VBO.
I/MaliBase(26028): This is an application error that may cause a pagefault in hardware.
I’m using the simplest possible models, about 30 objects moving vehicles with very little vertices (700vert 400trian) to keep the scene below 15,000 vertices and 100 objects. If I put 2 or 3 cars, the used memory is parked in a few mb, but if I put more objects of the cars, the memory used starts to up quickly. On the desktop the System.gc () frees the memory with a small role (if FreeMem <100mb) but in android does not work. I’ll keep trying to find, perhaps checking collisions. Maybe is not nifty…
even looking many objects to the scene, the game runs well at a good rate fps on the noname android 2.3 single core device with 256mb of ram … until the memory burst, which does not always happen. I’m searching for the vertexbuffer object, maybe increasing (or decreasing) the buffer size (34,66kb set on the GLES20.java)
I removed all the lights and left only a directional light on the scene and the error out of memory has not returned to appear. But it is still occurring the application error on the console on a tablet android 4.4. No idea what that is, but it seems that a buffer exceeds the size allowed by the system (But apparently not affecting the operation of the game.)