Problem with AWTText

Hello people.

I am new with JME and realize a small application that it draws grafos 3d.

And that to show text I use the component AWTText. Very good, certainly.

But when when I have to show great quantity of text the following exception happens to me:

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Direct buffer memory
   at java.nio.Bits.reserveMemory(Bits.java:633)
   at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
   at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
   at com.jme.util.geom.BufferUtils.createByteBuffer(Unknown Source)
   at com.jme.util.TextureManager.loadImage(Unknown Source)
   at com.alloy3dvisulizer.utils.AWTTextFactory.generateImage(AWTTextFactory.java:84)
   at com.alloy3dvisulizer.utils.AWTTextFactory.createText(AWTTextFactory.java:40)
   at com.alloy3dvisulizer.utils.AtributosVisuales.crearTexto(AtributosVisuales.java:93)
   at com.alloy3dvisulizer.utils.AtributosVisuales.crearAtributoParaConector(AtributosVisuales.java:71)
   at com.alloy3dvisulizer.utils.AtributosVisuales.<init>(AtributosVisuales.java:44)
   at com.alloy3dvisulizer.AlloyToGraph.NodoConector.inicializarAtributosVisuales(NodoConector.java:42)
   at com.alloy3dvisulizer.AlloyToGraph.InfoAlloy.inicializarElementosGraficables(InfoAlloy.java:375)
   at com.alloy3dvisulizer.gui.Alloy3DVisualizerWindows.loadFile(Alloy3DVisualizerWindows.java:216)
   at com.alloy3dvisulizer.gui.Alloy3DVisualizerWindows.jMenuItemAbrirActionPerformed(Alloy3DVisualizerWindows.java:245)
   at com.alloy3dvisulizer.gui.Alloy3DVisualizerWindows.access$2(Alloy3DVisualizerWindows.java:226)
   at com.alloy3dvisulizer.gui.Alloy3DVisualizerWindows$6.actionPerformed(Alloy3DVisualizerWindows.java:381)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
   at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
   at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
   at java.awt.Component.processMouseEvent(Component.java:6100)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
   at java.awt.Component.processEvent(Component.java:5865)
   at java.awt.Container.processEvent(Container.java:2058)
   at java.awt.Component.dispatchEventImpl(Component.java:4472)
   at java.awt.Container.dispatchEventImpl(Container.java:2116)
   at java.awt.Component.dispatchEvent(Component.java:4302)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
   at java.awt.Container.dispatchEventImpl(Container.java:2102)
   at java.awt.Window.dispatchEventImpl(Window.java:2440)
   at java.awt.Component.dispatchEvent(Component.java:4302)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)



Help me please!!  :?

Sounds like it is passing a very large image to jME.

renanse, thanks for your reply.

then there is no solution?

-Xmx512m?

darkfrog,

One of the things that probe was it and nothing.

anyway, thank

try:

-XX:MaxDirectMemorySize=<value>


see also:
http://blogs.sun.com/watt/resource/jvm-options-list.html


-Xss<size> set maximum native stack size for any thread
-Xoss<size> set maximum Java stack size for any thread. Note: This option is useless with HotSpot as HotSpot doesn't have separate native and Java stacks.
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size