Bug 85296 - OutOfMemoryError when attempting to Apply Design Pattern on recursive schema
OutOfMemoryError when attempting to Apply Design Pattern on recursive schema
Status: VERIFIED FIXED
Product: xml
Classification: Unclassified
Component: Schema Tools
5.x
PC Windows XP
: P1 (vote)
: 5.x
Assigned To: Ayub Khan
issues@xml
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-20 02:27 UTC by htt
Modified: 2006-10-03 01:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
ctrl-break trace (25.09 KB, text/plain)
2006-09-21 19:11 UTC, Samaresh Panda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description htt 2006-09-20 02:27:59 UTC
Create a Java App.
   In Projects, right-click Source Packages, choose File/Folder
   In New File wizard,
     Categories: click on XML
     File Types: select External XML Schema Documents(s)
     click Next
     select From URL
     In the text field below it, type
http://docs.oasis-open.org/ubl/cd-UBL-1.0/xsd/maindoc/UBL-Order-1.0.xsd
     accept all other defaults
     click
   In Projects, right-click Source Packages, choose File/Folder
   In New File wizard,
     Categories: click on XML
     File Types: XML Schema
     click Next
     accept all other defaults
     click Finish
   Open newXmlSchema.xsd
   In Schema view, right-click namespace, choose Add > Import
   In Import popup, expand By File until UBL-Order-1.0.xsd is visible
   Select UBL-Order-1.0.xsd
   Enter value for New Prefix
   click OK
   In Schema view,
     add global element E
     in Element popup,
       select Use Existing Type
       expand Referenced Schemas > import > Complex Types
       select OrderType
       click OK
   In Projects, right-click newXmlSchema.xsd, choose Apply Design Pattern
   In Apply Design Pattern wizard, attempt to change to another pattern
   by selecting any of the radio button
   => IDE hangs and eventually results in java.lang.OutOfMemoryError: Java heap
space
      In Source view, observe:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/schema/newXMLSchema"
            xmlns:tns="http://xml.netbeans.org/schema/newXMLSchema"
            elementFormDefault="qualified"
xmlns:ayub="urn:oasis:names:tc:ubl:Order:1:0">
    <xsd:import schemaLocation="xsd/maindoc/UBL-Order-1.0.xsd"
namespace="urn:oasis:names:tc:ubl:Order:1:0"/>
    <xsd:element name="E" type="ayub:OrderType"/>
</xsd:schema>
Comment 1 Ayub Khan 2006-09-20 05:41:36 UTC
Chris, can you take a look at this issue. Possible deadlock is found. The stack
trace is given below.

Full thread dump Java HotSpot(TM) Client VM (1.5.0_05-b05 mixed mode):

"Default RequestProcessor" daemon prio=2 tid=0x1dee0a08 nid=0xf14 in Object.wait
() [0x1d83f000..0x1d83fae8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x055b8368> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:885)
        - locked <0x055b8368> (a java.lang.Object)

"Timer-3" prio=7 tid=0x1cf178f0 nid=0xe18 in Object.wait() [0x1dcff000..0x1dcffc
e8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x051ac700> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:474)
        at java.util.TimerThread.mainLoop(Timer.java:483)
        - locked <0x051ac700> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

"Timer-1" prio=7 tid=0x1e0667b8 nid=0x7ac in Object.wait() [0x1d7ef000..0x1d7efc
e8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x04f826f8> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:474)
        at java.util.TimerThread.mainLoop(Timer.java:483)
        - locked <0x04f826f8> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

"MDR event dispatcher" daemon prio=2 tid=0x1e19b3f8 nid=0xbc in Object.wait() [0
x1da0f000..0x1da0fae8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x047f9260> (a java.util.LinkedList)
        at java.lang.Object.wait(Object.java:474)
        at org.netbeans.mdr.util.EventNotifier$EventsDelivery.run(EventNotifier.
java:263)
        - locked <0x047f9260> (a java.util.LinkedList)
        at java.lang.Thread.run(Thread.java:595)

"DestroyJavaVM" prio=5 tid=0x00039118 nid=0xbbc waiting on condition [0x00000000
..0x0007fae8]

"AWT-EventQueue-1" prio=7 tid=0x1d14ccf0 nid=0xe10 runnable [0x1d7ae000..0x1d7af
9e8]
        at org.openide.util.WeakListenerImpl$ProxyListener.<init>(WeakListenerIm
pl.java:357)
        at org.openide.util.WeakListenerImpl.create(WeakListenerImpl.java:119)
        at org.openide.util.WeakListeners.create(WeakListeners.java:199)
        at org.netbeans.modules.xml.xdm.xam.XDMAccess.setAutoSync(XDMAccess.java
:391)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.getAccess(
SchemaModelImpl.java:261)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.getAccess(
SchemaModelImpl.java:49)
        at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:23
0)
        - locked <0x02fefcc8> (a org.netbeans.modules.xml.schema.model.impl.Sche
maModelImpl)
        at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractMo
delFactory.java:83)
        - locked <0x0468b5a8> (a org.netbeans.modules.xml.schema.model.SchemaMod
elFactory)
        at org.netbeans.modules.xml.schema.model.SchemaModelFactory.getModel(Sch
emaModelFactory.java:95)
        at org.netbeans.modules.xml.schema.model.impl.ImportImpl.resolveReferenc
edModel(ImportImpl.java:95)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.checkImpor
tedSchemas(SchemaModelImpl.java:173)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl._findSchem
as(SchemaModelImpl.java:128)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.findSchema
s(SchemaModelImpl.java:99)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.findSchema
s(SchemaModelImpl.java:49)
        at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.getSch
emas(GlobalReferenceImpl.java:60)
        at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.get(Gl
obalReferenceImpl.java:66)
        at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.get(Gl
obalReferenceImpl.java:39)
        at org.netbeans.modules.xml.axi.impl.SchemaGeneratorUtil.findMasterGloba
lElements(SchemaGeneratorUtil.java:1733)
        at org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.canTrans
formSchema(SchemaGeneratorFactoryImpl.java:86)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ction.isValid(SchemaTransformPatternSelection.java:93)
        at org.openide.WizardDescriptor.updateState(WizardDescriptor.java:629)
        - locked <0x05622d10> (a org.openide.WizardDescriptor)
        at org.openide.WizardDescriptor$Listener.stateChanged(WizardDescriptor.j
ava:1615)
        at org.openide.util.WeakListenerImpl$Change.stateChanged(WeakListenerImp
l.java:284)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ction.fireChangeEvent(SchemaTransformPatternSelection.java:187)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ction.stateChanged(SchemaTransformPatternSelection.java:221)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ctionUI.fireChange(SchemaTransformPatternSelectionUI.java:182)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ctionUI.selectPattern(SchemaTransformPatternSelectionUI.java:128)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ctionUI.access$000(SchemaTransformPatternSelectionUI.java:13)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformPatternSele
ctionUI$1.itemStateChanged(SchemaTransformPatternSelectionUI.java:53)
        at javax.swing.AbstractButton.fireItemStateChanged(AbstractButton.java:1
877)
        at javax.swing.AbstractButton$Handler.itemStateChanged(AbstractButton.ja
va:2176)
        at javax.swing.DefaultButtonModel.fireItemStateChanged(DefaultButtonMode
l.java:477)
        at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton
.java:233)
        at javax.swing.ButtonGroup.setSelected(ButtonGroup.java:137)
        at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton
.java:215)
        at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.
java:250)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:234)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
31)
        at java.awt.Component.processMouseEvent(Component.java:5488)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
        at java.awt.Component.processEvent(Component.java:5253)
        at java.awt.Container.processEvent(Container.java:1966)
        at java.awt.Component.dispatchEventImpl(Component.java:3955)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
        at java.awt.Container.dispatchEventImpl(Container.java:2010)
        at java.awt.Window.dispatchEventImpl(Window.java:1774)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:153)
        at java.awt.Dialog$1.run(Dialog.java:515)
        at java.awt.Dialog.show(Dialog.java:536)
        at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.
java:816)
        at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.jav
a:859)
        at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:8
47)
        at org.openide.util.Mutex.doEventAccess(Mutex.java:1178)
        at org.openide.util.Mutex.readAccess(Mutex.java:215)
        at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:
832)
        at java.awt.Component.show(Component.java:1300)
        at java.awt.Component.setVisible(Component.java:1253)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformWizard.show
(SchemaTransformWizard.java:136)
        at org.netbeans.modules.xml.schema.core.actions.SchemaTransformAction.sh
owWizard(SchemaTransformAction.java:134)
        at org.netbeans.modules.xml.schema.core.actions.SchemaTransformAction.pe
rformAction(SchemaTransformAction.java:66)
        at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.j
ava:537)
        at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(Actio
nsBridge.java:53)
        at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(No
deAction.java:533)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
49)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
a:2169)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1
000)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMen
uItemUI.java:1041)
        at java.awt.Component.processMouseEvent(Component.java:5488)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
        at java.awt.Component.processEvent(Component.java:5253)
        at java.awt.Container.processEvent(Container.java:1966)
        at java.awt.Component.dispatchEventImpl(Component.java:3955)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
        at java.awt.Container.dispatchEventImpl(Container.java:2010)
        at java.awt.Window.dispatchEventImpl(Window.java:1774)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

"TimerQueue" daemon prio=5 tid=0x1d1b4ac0 nid=0x2bc in Object.wait() [0x1d76f000
..0x1d76fa68]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x045382e8> (a javax.swing.TimerQueue)
        at javax.swing.TimerQueue.run(TimerQueue.java:233)
        - locked <0x045382e8> (a javax.swing.TimerQueue)
        at java.lang.Thread.run(Thread.java:595)

"Java2D Disposer" daemon prio=10 tid=0x1d17a958 nid=0x8f4 in Object.wait() [0x1d
67f000..0x1d67f9e8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x03ed97f8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x03ed97f8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at sun.java2d.Disposer.run(Disposer.java:107)
        at java.lang.Thread.run(Thread.java:595)

"AWT-Windows" daemon prio=7 tid=0x1d0c40a8 nid=0xf20 runnable [0x1d61f000..0x1d6
1fa68]
        at sun.awt.windows.WToolkit.eventLoop(Native Method)
        at sun.awt.windows.WToolkit.run(WToolkit.java:269)
        at java.lang.Thread.run(Thread.java:595)

"AWT-Shutdown" prio=5 tid=0x1d143e88 nid=0x460 in Object.wait() [0x1d5df000..0x1
d5dfae8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x03ed9820> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:474)
        at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
        - locked <0x03ed9820> (a java.lang.Object)
        at java.lang.Thread.run(Thread.java:595)

"Timer-0" daemon prio=5 tid=0x00a93518 nid=0xcd0 in Object.wait() [0x1d53f000..0
x1d53fb68]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x03ed9848> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:509)
        - locked <0x03ed9848> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

"CLI Requests Server" daemon prio=5 tid=0x1d16e7f8 nid=0xe24 runnable [0x1d4bf00
0..0x1d4bfc68]
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        - locked <0x03e8cbe8> (a java.net.SocksSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:450)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at org.netbeans.CLIHandler$Server.run(CLIHandler.java:867)

"Active Reference Queue Daemon" daemon prio=2 tid=0x1ce45b78 nid=0xf98 in Object
.wait() [0x1d04f000..0x1d04fce8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x03e8cd08> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x03e8cd08> (a java.lang.ref.ReferenceQueue$Lock)
        at org.openide.util.Utilities$ActiveQueue.run(Utilities.java:3002)
        at java.lang.Thread.run(Thread.java:595)

"Low Memory Detector" daemon prio=5 tid=0x00a9e288 nid=0x84 runnable [0x00000000
..0x00000000]

"CompilerThread0" daemon prio=10 tid=0x00a9c970 nid=0xa98 waiting on condition [
0x00000000..0x1cd8f7cc]

"Signal Dispatcher" daemon prio=10 tid=0x00a9bbf8 nid=0x664 waiting on condition
 [0x00000000..0x00000000]

"JDWP Event Helper Thread" daemon prio=5 tid=0x00a9a9c0 nid=0xb70 runnable [0x00
000000..0x00000000]

"JDWP Transport Listener: dt_socket" daemon prio=5 tid=0x00a93c30 nid=0x294 runn
able [0x00000000..0x00000000]

"Finalizer" daemon prio=9 tid=0x00a8a118 nid=0x558 in Object.wait() [0x1cc8f000.
.0x1cc8fc68]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x03e8cdf0> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x03e8cdf0> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x00a88c88 nid=0xf7c in Object.wait() [0x
1cc4f000..0x1cc4fce8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x03e8cb30> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:474)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
        - locked <0x03e8cb30> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=10 tid=0x00a862b8 nid=0x964 runnable

"VM Periodic Task Thread" prio=10 tid=0x00a9f4d0 nid=0x5b4 waiting on condition

Comment 2 Chris Webster 2006-09-20 17:36:33 UTC
The stack trace doesn't look like a deadlock at first glance. 
Comment 3 Samaresh Panda 2006-09-21 18:52:23 UTC
The IDE does hang, but I dont get an OOM exception. I waited for about 15mins.
My guess is that, the code gets into an infinite loop, not sure where and how.
Ayub will be the best person to understand this.
Comment 4 Samaresh Panda 2006-09-21 19:11:25 UTC
Created attachment 34330 [details]
ctrl-break trace
Comment 5 Ayub Khan 2006-09-22 00:39:42 UTC
Fixed.

Files changed:

/cvs/xml/axi/src/org/netbeans/modules/xml/axi/impl/Attic/SchemaGeneratorUtil.java
new revision: 1.1.2.22; previous revision: 1.1.2.21

/cvs/xml/axi/src/org/netbeans/modules/xml/axi/impl/Attic/DefaultSchemaGenerator.java
new revision: 1.1.2.52; previous revision: 1.1.2.51

/cvs/xml/axi/src/org/netbeans/modules/xml/axi/visitor/Attic/AXINonCyclicVisitor.java
new revision: 1.1.2.4; previous revision: 1.1.2.3

/cvs/xml/axi/src/org/netbeans/modules/xml/axi/visitor/Attic/FindUsageVisitor.java,
new revision: 1.1.2.9; previous revision: 1.1.2.8
Comment 6 Ayub Khan 2006-09-22 00:42:45 UTC
The current behaviour will be that if you try to ADP on a schema 'A' that
imports from  other schema model 'B', we only expand and apply design pattern on
components in schema 'A'. So for this testcase, the wizard wont allow to adp
since there is no child elements or attributes for the single global element in 'A'.
Comment 7 htt 2006-09-25 19:14:48 UTC
Verified in CB 060925_10.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo