Android RendererException

Hi everyone!

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 at at
com.jme3.renderer.RenderManager.setViewPort( at
com.jme3.renderer.RenderManager.setCamera( at
com.jme3.renderer.RenderManager.renderViewPort( at
com.jme3.renderer.RenderManager.render( at at at at
android.opengl.GLSurfaceView$GLThread.guardedRun( 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 …

Thanks if anyone can help

ps.: no problem on desktop, just android

I’ve been analyzing the output of the exception… i think the mobile memory is going to the air after running the following command (in the 3.0 source), and the exception is thrown after:


I’ve read somewhere here in the forum that this SCISSOR_TEST allocates an object (ScissorRectangle) for every object and every frame! And that is bad for small memory of the mobile.

I will comment the line that calls the test at source, recompile and test. And then I bring the news …

If there’s any allocation, its not by jME3. It just gets translated into OpenGL ES calls:

Complex nifty UIs might be using the clipping feature a lot, which I guess might be difficult for some OpenGL drivers to handle?

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 but the exception is thrown elsewhere, does not solve the problem that apparently does not come from jme3 code.

Monitoring memory usage via the controls:


… 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

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.)

The problem came back again! And I discovered that @Momoko_Fan was completely right! Thanks!

Nifty gui seems to be very heavy for android with complex UI. I’ll try something simpler!

Actually the message clearly says application error, which in this case means engine error. I am guessing the unified renderer in jME 3.1 probably fixed the issue.

I’ll try, thanks!