jshiell / checkstyle-idea

CheckStyle plug-in for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Other
885 stars 160 forks source link

Checkstyle scans completely trash IDEA #225

Closed mmoayyed closed 8 years ago

mmoayyed commented 8 years ago

Running IDEA 15.0.5 on Windows 10 x64, with about 16GB of Ram, Intel Core-i7 2.6Ghz. Running the latest version of this plugin. Attempting to scan this repository with the rules defined: https://github.com/Jasig/cas

About 60% into the process, IDEA is totally trashed:

2016-04-05 03:51:52,008 [ 252425]   INFO - ea.checkstyle.CheckStylePlugin - Scanning current file(s). 
2016-04-05 03:55:26,172 [ 466589]  ERROR - a.checkstyle.checker.ScanFiles - An error occurred while scanning a file. 
org.infernus.idea.checkstyle.exception.CheckStylePluginException: An error occurred during a file scan.
    at org.infernus.idea.checkstyle.exception.CheckStylePluginException.wrap(CheckStylePluginException.java:44)
    at org.infernus.idea.checkstyle.checker.ScanFiles.call(ScanFiles.java:85)
    at org.infernus.idea.checkstyle.checker.ScanFiles.call(ScanFiles.java:30)
    at com.intellij.openapi.application.impl.ApplicationImpl$9.call(ApplicationImpl.java:391)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:714)
    at org.infernus.idea.checkstyle.checker.CheckerFactory.executeWorker(CheckerFactory.java:192)
    at org.infernus.idea.checkstyle.checker.CheckerFactory.createChecker(CheckerFactory.java:163)
    at org.infernus.idea.checkstyle.checker.CheckerFactory.getOrCreateCachedChecker(CheckerFactory.java:82)
    at org.infernus.idea.checkstyle.checker.CheckerFactory.checker(CheckerFactory.java:61)
    at org.infernus.idea.checkstyle.checker.CheckerFactory.checker(CheckerFactory.java:47)
    at org.infernus.idea.checkstyle.checker.ScanFiles.checkFiles(ScanFiles.java:192)
    at org.infernus.idea.checkstyle.checker.ScanFiles.processFilesForModuleInfoAndScan(ScanFiles.java:151)
    at org.infernus.idea.checkstyle.checker.ScanFiles.call(ScanFiles.java:77)
    ... 7 more
2016-04-05 03:55:26,194 [ 466611]  ERROR - nsions.impl.ExtensionPointImpl - null 
com.intellij.openapi.extensions.impl.PicoPluginExtensionInitializationException
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:96)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getExtension(ExtensionComponentAdapter.java:119)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:249)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:194)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:100)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:87)
    at com.intellij.diagnostic.IdeErrorsDialog.getSubmitter(IdeErrorsDialog.java:1003)
    at com.intellij.diagnostic.DefaultIdeaErrorLogger.canHandle(DefaultIdeaErrorLogger.java:55)
    at com.intellij.diagnostic.DialogAppender.appendToLoggers(DialogAppender.java:109)
    at com.intellij.diagnostic.DialogAppender$1.run(DialogAppender.java:71)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:866)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.OutOfMemoryError
    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 com.intellij.util.lang.JarLoader.getZipFile(JarLoader.java:193)
    at com.intellij.util.lang.JarLoader.getResource(JarLoader.java:136)
    at com.intellij.util.lang.ClassPath$ResourceStringLoaderIterator.process(ClassPath.java:342)
    at com.intellij.util.lang.ClassPath$ResourceStringLoaderIterator.process(ClassPath.java:332)
    at com.intellij.util.lang.ClasspathCache.iterateLoaders(ClasspathCache.java:98)
    at com.intellij.util.lang.ClassPath.getResource(ClassPath.java:106)
    at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:219)
    at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:124)
    at com.intellij.ide.plugins.cl.PluginClassLoader.a(PluginClassLoader.java:77)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.loadImplementationClass(ExtensionComponentAdapter.java:157)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentImplementation(ExtensionComponentAdapter.java:66)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:73)
    ... 26 more
Caused by:

Note that my IDE is optimized for max performance via the JRebel optimizer plugin.

What gives?

jshiell commented 8 years ago

Absolutely nothing gives AFAIK. I imported your project via Gradle, attached JMC and proceeded to run a full scan four times. The JVM heap averaged about ~520Mb idle, and never went beyond 640Mb. GC seemed to proceed happily with no blatantly obviously leaks, dropping down to ~400Mb after post-scan GC, and CPU usage never broke 50%.

The only change from earlier versions is that Checkers are cached by module rather than by project, to allow variables such as basedir to vary by module.

This is all using the default OS X IDEA 15.0.5 bundle, with JDK 1.8.0_40 and default memory configuration.

mmoayyed commented 8 years ago

This is bizarre. I can get it to crash constantly half way into the scan. With IDEA 2016 it works just fine, and I do have the same configuration as far as I know. Is there anything I could pass along to make the diagnosis of this issue easier? logs, settings, etc?

mmoayyed commented 8 years ago

Try the following please. In the same Jasig/cas project, checkout the "letsboot" branch and have the plugin scan that branch within IDEA. I think that's the only difference here, besides me trying this on a windows machine with a JDK 8 level slightly higher than you.

jshiell commented 8 years ago

I've just run three consecutive scans on that branch with no issues.

TBH I've no plans to look any further at this, as as far as I can determine the plugin isn't leaking memory. Given IDEA 2016 is working for you, my guess is it's merely a low memory problem - possible causes could be differences in IDEA memory usage, in how the Windows JVM (or indeed Windows itself, in the case of the native pool) handles memory or just in other plugins and such using their own memory. In any case, the current evidence points at it being environmental.