This discussion is archived
2 Replies Latest reply: Jul 31, 2009 9:37 AM by 843810 RSS

javahelp system - out of memory

843810 Newbie
Currently Being Moderated
When I press F1 10 times, exception below exist.What will I do to solve the problem? Is any pararmeter in the javahelp System to enlarge memory?
Exception occurred during event dispatching:
java.lang.OutOfMemoryError: Java heap space
     at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41) 
     at java.awt.image.Raster.createPackedRaster(Raster.java:458)
     at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
     at sun.awt.Win32GraphicsConfig.createAcceleratedImage(Win32GraphicsConfig.java:368)
     at sun.awt.windows.WComponentPeer.createImage(WComponentPeer.java:497)
     at java.awt.Component.createImage(Component.java:2994)
     at java.awt.Component.createImage(Component.java:2991)
     at java.awt.Component.createImage(Component.java:2991)
     at java.awt.Component.createImage(Component.java:2991)
     at java.awt.Component.createImage(Component.java:2991)
     at java.awt.Component.createImage(Component.java:2991)
     at java.awt.Component.createImage(Component.java:2991)
     at java.awt.Component.createImage(Component.java:2991)
     at javax.swing.JViewport.paint(JViewport.java:750)
     at javax.swing.JComponent.paintChildren(JComponent.java:843)
     at javax.swing.JComponent.paint(JComponent.java:1015)
     at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4972)
     at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4925)
     at javax.swing.JComponent._paintImmediately(JComponent.java:4868)
     at javax.swing.JComponent.paintImmediately(JComponent.java:4675)
     at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
     at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
     at java.awt.Dialog$1.run(Dialog.java:535)
     at java.awt.Dialog$2.run(Dialog.java:563)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.awt.Dialog.show(Dialog.java:561)
  • 1. Re: javahelp system - out of memory
    843810 Newbie
    Currently Being Moderated
    You mean without closing any previous window? Or just 10th time you ask for help? Are you maybe having multiple helpset instances? Could you post a bit of your code, just to see what F1 does and how and when HelpSet is initialized?
  • 2. Re: javahelp system - out of memory
    843810 Newbie
    Currently Being Moderated
    I'v got memory leak just pressing F1 n times (closing window after each time). The same result I've got with sun javahelp idedemo. My sample is following (no difference between sun's standard demo)

    public class HelpTestPropertyDlg extends JPanel implements PanelDelegator
    {
    public HelpTestPropertyDlg()
    {
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    }

    initHelpSet();

    }

    protected void initHelpSet()
    {
    String helpsetName = "TestProject";
    try
    {
    System.out.println("Searching for HelpSet");
    ClassLoader cl = this.getClass().getClassLoader();
    URL url = HelpSet.findHelpSet(cl, helpsetName);
    mainHS = new HelpSet(cl, url);

    mainHB = mainHS.createHelpBroker();
    mainHB.enableHelpKey(this, "basics_permissions_newoperator", mainHS,"javax.help.MainWindow"/* "javax.help.SecondaryWindow"*/, "test");
    // mainHB.enableHelp(this,"basics_permissions_newoperator",mainHS);
    mainHB.enableHelp(jAddrField,"basics_sysstructure_sysconfig",mainHS);

    jWTFButton.addActionListener(new CSH.DisplayHelpAfterTracking(mainHS,"javax.help.Popup", ""));




    } catch (Exception ex)
    {
    System.out.println ("Help Set "+helpsetName+" not found");
    ex.printStackTrace();
    }

    }

    .....
    }