[jbosstools-issues] [JBoss JIRA] (JBIDE-20593) JBoss Tools builders are very slow with large jar libraries

Alexey Kazakov (JIRA) issues at jboss.org
Wed Sep 9 07:56:00 EDT 2015


    [ https://issues.jboss.org/browse/JBIDE-20593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13106818#comment-13106818 ] 

Alexey Kazakov commented on JBIDE-20593:
----------------------------------------

It turned out that we can enable Zip cache in JDT for the thread. With that cache enabled, JDT doesn't unpack the jar we are scanning for every queried type.
The change is actually very small: 
{code}
JavaModelManager manager = JavaModelManager.getJavaModelManager();
try {
     manager.cacheZipFiles(this);
    // Do the job 
    ....
} finally {
     manager.flushZipFiles(this);
}
{code}
The rest is just a code formatting.
This is an internal API though.
It reduced KB building time dramatically. In this case from minutes (5-10 minutes) to a few seconds.

> JBoss Tools builders are very slow with large jar libraries
> -----------------------------------------------------------
>
>                 Key: JBIDE-20593
>                 URL: https://issues.jboss.org/browse/JBIDE-20593
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: batch, cdi
>    Affects Versions: 4.3.0.Beta2
>            Reporter: Viacheslav Kabanovich
>            Assignee: Viacheslav Kabanovich
>            Priority: Critical
>             Fix For: 4.3.0.CR1
>
>
> 1. Have a working Eclipse Mars workspace with Maven project with JBoss Tools 4.3.0.Beta2 installed.
> 2. Add the following glassfish-embedded-all : //developer 4 . jboss 1 dependency to pom . xml
> {code}
> <dependency>
>     <groupId>org.glassfish.main.extras</groupId>
>     <artifactId>glassfish-embedded-all</artifactId>
>     <version>4.1</version>
> </dependency>
> {code}
> 3. FAILURE: JBoss Knowledge Base Builder is started and takes about 5 minutes to finish.
> 4. FAILURE: Restart eclipse. JBoss Knowledge Base Builder is started again and takes about 5 minutes to finish.
> This jar is a big one. About 80MB.
> Typical stacktrace:
> {code}
> "Worker-2186" #3405 prio=5 os_prio=0 tid=0x000000000112f800 nid=0x4094 runnable [0x00007f60a8af0000]
>    java.lang.Thread.State: RUNNABLE
>   at java.util.zip.ZipFile.open(Native Method)
>   at java.util.zip.ZipFile.<init>(ZipFile.java:220)
>   at java.util.zip.ZipFile.<init>(ZipFile.java:150)
>   at java.util.zip.ZipFile.<init>(ZipFile.java:164)
>   at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2678)
>   at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2644)
>   at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:156)
>   at org.eclipse.jdt.internal.core.ClassFile.getJarBinaryTypeInfo(ClassFile.java:355)
>   at org.eclipse.jdt.internal.core.ClassFile.getBinaryTypeInfo(ClassFile.java:290)
>   at org.eclipse.jdt.internal.core.ClassFile.getBinaryTypeInfo(ClassFile.java:284)
>   at org.eclipse.jdt.internal.core.ClassFile.buildStructure(ClassFile.java:93)
>   at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:259)
>   at org.eclipse.jdt.internal.core.SourceRefElement.generateInfos(SourceRefElement.java:107)
>   at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:579)
>   at org.eclipse.jdt.internal.core.BinaryType.getElementInfo(BinaryType.java:287)
>   at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:302)
>   at org.eclipse.jdt.internal.core.BinaryType.getAnnotations(BinaryType.java:185)
>   at org.jboss.tools.batch.internal.core.impl.definition.AbstractMemberDefinition.init(AbstractMemberDefinition.java:85)
>   at org.jboss.tools.batch.internal.core.impl.definition.AbstractTypeDefinition.init(AbstractTypeDefinition.java:62)
>   at org.jboss.tools.batch.internal.core.impl.definition.TypeDefinition.init(TypeDefinition.java:44)
>   at org.jboss.tools.batch.internal.core.impl.definition.AbstractMemberDefinition.setAnnotatable(AbstractMemberDefinition.java:60)
>   at org.jboss.tools.batch.internal.core.impl.definition.AbstractTypeDefinition.setType(AbstractTypeDefinition.java:56)
>   at org.jboss.tools.batch.internal.core.impl.BatchBuilder.build(BatchBuilder.java:259)
> {code}
> JDT opens new ZipFile for every queried type from that jar.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list