Help with java.lang.OutOfMemoryError: Direct buffer memory

This exception is called when my program call this line some times( haven’t a specifc number of times)

[java]jmeDesktop.setup(displayWidth, displayHeight, false, input);[/java]

displayWidth takes the width from display.width and displayHeight make the same.

I have to create input every time of I pass for this line :confused:

HELP, I need this ready for next week =X

There is not enough heap space for your JVm.

When launching the jvm use those options -Xms128m -Xmx128m for example.

-Xms define the minimum heap size, Xmx the maximum.

In my example they are both set to 128 Mb, you can play with those value until you don’t have the error anymore.

Thank nehon

You really found the problem, but I think my input object or the method setup from JMEDesktop are creating memory spaces that aren’t cleaned for the Garbage Collection, because how much I increase the space in Xmx and Xms, the exception only takes more time to be called :/. You know something about it?

Sorry if I wrote a bad english, but I am brazillian, and don’t drin caipirinha or play futball :smiley:

I remember trying to use JMEDesktop for JME2 back when I was looking for a GUI solution. Sadly, I ran into the same problem. It is my belief that there is a memory leak somewhere in there, because my program would take an infinite amount of memory (usually bogging my computer down around 700 MBs.

I switched to GBUI, worked much better with no memory leak.

Hum, ok Eggsworth, I will study this GBUI, but not for now.

Is it very different from BUI?8O