Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4094305

Frame peer causes OutOfMemoryException or hang

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P1
    • None
    • 1.1.4
    • client-libs
    • None
    • x86
    • windows_95

    Description

      [chamness 11/20/97]

      Under 1.1.4, the following test code will hang after 1200 interations on
      a win_95 system. It slows my Solaris 2.5.1 machine to the point
      of being unresponsive. There is no problem when running under 1.0.2
      on Solaris.
      ----------------------------------------------------------------------
      import java.awt.*;

      class tester
      {
      public static void main(String args[])
      {
      int count=0;
      while(true)
      {
      System.out.println(count++);
      Frame f= new Frame("my Frame");
      f.pack();
      }
      }
      }
      ----------------------------------------------------------------------
      Part of the Solaris output using -verbosegc:

      <GC: init&scan: 13 ms, scan handles: 1332 ms, sweep: 0 ms, compact: 0 ms>
      <GC(async, interrupted): freed 0 objects, 0 bytes in 1306 ms, 21% free (2926448/13315272)>
      <GC: init&scan: 12 ms, scan handles: 1294 ms, sweep: 0 ms, compact: 0 ms>
      <GC(async, interrupted): freed 0 objects, 0 bytes in 1297 ms, 21% free (2926448/13315272)>
      <GC: init&scan: 12 ms, scan handles: 1285 ms, sweep: 0 ms, compact: 0 ms>
      <GC(async, interrupted): freed 0 objects, 0 bytes in 1283 ms, 21% free (2926448/13315272)>
      <GC: init&scan: 12 ms, scan handles: 1271 ms, sweep: 0 ms, compact: 0 ms>
      <GC(async, interrupted): freed 0 objects, 0 bytes in 1273 ms, 21% free (2926448/13315272)>
      <GC: init&scan: 12 ms, scan handles: 1261 ms, sweep: 0 ms, compact: 0 ms>
      <GC(async, interrupted): freed 0 objects, 0 bytes in 1465 ms, 21% free (2926448/13315272)>
      <GC: init&scan: 16 ms, scan handles: 1449 ms, sweep: 0 ms, compact: 0 ms>
      <GC(async, interrupted): freed 0 objects, 0 bytes in 1335 ms, 21% free (2926448/13315272)>
      <GC: init&scan: 12 ms, scan handles: 1323 ms, sweep: 0 ms, compact: 0 ms>

      ----------------------------------------------------------------------
      Running the same code on the same win_95 machine, doesn't hang anymore.
      (I guess the computer changed its mind.) It now throws an exception:

      1081
      1082
      1083
      1084
      1085
      1086
      1087
      1088
      1089
      java.lang.OutOfMemoryError: invalid peer
      at sun.awt.windows.WComponentPeer.<init>(WComponentPeer.java:173)
      at sun.awt.windows.WCanvasPeer.<init>(WCanvasPeer.java:36)
      at sun.awt.windows.WPanelPeer.<init>(WPanelPeer.java:47)
      at sun.awt.windows.WWindowPeer.<init>(WWindowPeer.java:65)
      at sun.awt.windows.WFramePeer.<init>(WFramePeer.java:55)
      at sun.awt.windows.WToolkit.createFrame(WToolkit.java:179)
      at java.awt.Frame.addNotify(Frame.java:201)
      at java.awt.Window.pack(Window.java:122)
      at tester.main(tester.java:12)


      This only happens when the peer is created. The same error message
      is generated if Frame.addNotify() is called.

      My guess is that when the win_95 machine was hanging earlier
      it was also caused by an OutOfMemoryError. But when the VM tried to load
      that exception class, it threw a new OutOfMemoryError, going into
      an infinite loop.

      Attachments

        Issue Links

          Activity

            People

              lbunnisunw Lara Bunni (Inactive)
              mchamnessunw Mark Chamness (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: