Re: [mdr-users] Performance problem with UML2 metamodel

Martin Matula <[email protected]> Thu, 26 Jan 2006 09:54:16 +0100
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi Mathias,
do you have the JMI interfaces generated from your UML metamodel on the 
classpath?
Martin

Matthias Bohlen wrote:
> Hi,
> 
> I am trying to make MDR work with a UML2 metamodel based on MOF1
> because we want to run AndroMDA with UML2 models from MagicDraw 10.
> 
> I have successfully loaded the metamodel into MDR (took about 3-4
> seconds). Then, I called
> org.netbeans.api.mdr.MDRepository.createExtent("model", metaModel)
> which surprisingly takes more than 60 seconds!
> 
> I ran the same thing in the debugger and suspended the thread. It
> turns out that MDR is calling a classloader a very large number of
> times, each time running through a lot of code:
> 
>         String.indexOf(char[], int, int, char[], int, int, int) line: not available
>         String.indexOf(String, int) line: not available
>         String.indexOf(String) line: not available
>         Handler(URLStreamHandler).parseURL(URL, String, int, int) line: not available
>         Handler.parseURL(URL, String, int, int) line: not available
>         URL.<init>(URL, String, URLStreamHandler) line: not available
>         URL.<init>(URL, String) line: not available
>         URLClassPath$FileLoader.getResource(String, boolean) line: not available
>         URLClassPath.getResource(String, boolean) line: not available
>         URLClassLoader$1.run() line: not available
>         AccessController.doPrivileged(PrivilegedExceptionAction, AccessControlContext) line: not available [native method]
>         Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not available
>         Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
>         Launcher$AppClassLoader.loadClass(String, boolean) line: not available
>         MDRClassLoader$Delegator(ClassLoader).loadClass(String, boolean) line: not available
>         MDRClassLoader$Delegator.accessibleLoadClass(String, boolean) line: 236
>         MDRClassLoader.loadClass(String, boolean) line: 128
>         MDRClassLoader(ClassLoader).loadClass(String) line: not available
>         MDRClassLoader(ClassLoader).loadClassInternal(String) line: not available
>         Class.forName0(String, boolean, ClassLoader) line: not available [native method]
>         Class.forName(String, boolean, ClassLoader) line: not available
>         BaseObjectHandler.resolveImplementation(String) line: 185
>         StorableClass.resolveClass(String) line: 576
>         StorableClass.resolveClass(StorableClass, int) line: 572
>         StorableClass.initInstanceSuperclass(Class[]) line: 586
>         StorableClass.initInstanceSuperclass(Class[]) line: 594
>         NBMDRepositoryImpl.resolveSuperclasses(MofPackage, List) line: 925
>         NBMDRepositoryImpl.instantiatePackage(String, StorablePackage, MofPackage, Map, String, boolean) line: 811
>         NBMDRepositoryImpl.createExtent(String, RefObject, RefPackage[], String) line: 486
>         NBMDRepositoryImpl.createExtent(String, RefObject, RefPackage[]) line: 291
>         NBMDRepositoryImpl.createExtent(String, RefObject) line: 279
> 
> When I inspect the following stack frame
> StorableClass.resolveClass(String) line: 576
> I see that
> className= "org.netbeans.jmiimpl.omg.uml2.support.communications.MessageEventImpl"
> 
> Profiling shows that MDRClassLoader$Delegator.accessibleLoadClass is
> called 44600 times using about 2 milliseconds for each call which adds
> up to 92 seconds alone.
> 
> What is happening here???
> 
> Cheers
> Matthias at AndroMDA.org
> 
>