Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on multi-project builds #182

Closed
arming9 opened this issue Feb 18, 2016 · 3 comments
Closed

Memory leak on multi-project builds #182

arming9 opened this issue Feb 18, 2016 · 3 comments
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series question
Milestone

Comments

@arming9
Copy link

arming9 commented Feb 18, 2016

Dear developers,

I'm facing a memory leak issue when building with the asciidoctor plugin in a multi-project scenario. Dependening on the JVM used it happens sooner or later. I've put together a verification project to reproduce the issue:

My project build.gradle is:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
    }
}

My settings.gradle is:

for(int n = 0; n < 30; n++) {
    def projectname = 'prj-'+n
    def newprojectdir = new File(rootDir, projectname)
    newprojectdir.mkdirs()
    new File(newprojectdir, 'build.gradle').text = '''
        repositories {
            jcenter()
        }
        apply plugin: 'org.asciidoctor.convert'
    '''.stripIndent()
    def ascidocroot = new File(newprojectdir, 'src/docs/asciidoc')
    ascidocroot.mkdirs()
    new File(ascidocroot, 'test.adoc').text = '''
        HELLO
        ===================
        :Author Initials: AC

        HELLO WORLD!!!

    '''.stripIndent()

    include projectname
}

This will create a multi-project build with 30 subprojects and each doing asciidoctor.
Start the build with

gradlew clean asciidoctor

Running on JDK8, you will have to
SET GRADLE_OPTS=-Xmx168m -Xms168m -Xss1m
in order to get straight to the leak.

My Gradle version is 2.10

In JDK6 and 7, you'll end up with a PermGenSpace OutOfMemory error after 3-5 projects,
In JDK8 it takes a little more (therefore restrict the memory with GRADLE_OPTS, otherwise the JVM grows without limit).

@manuelprinz
Copy link
Contributor

Although this is a really old bug, I was able to reproduce it under Java 8 with Gradle 2.10, 3.5.1 and 4.5.1.

@ysb33r
Copy link
Member

ysb33r commented Jul 1, 2018

Thanks. I am not going to look at this for 1.5.x, but it will be worthwile to create a manual test for this to test whether the same problem occurs for 2.0.x

@ysb33r ysb33r added question 1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series labels Jul 1, 2018
@ysb33r ysb33r added this to the 2.0.0 milestone Jul 1, 2018
@ysb33r ysb33r mentioned this issue Jul 2, 2018
28 tasks
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Jul 28, 2018
@ysb33r
Copy link
Member

ysb33r commented Jul 28, 2018

A test has been added to 2.0 to check for this and will be in the 2.0-alpha.3 codebase. It has to be executed manually for now.

@ysb33r ysb33r closed this as completed Jul 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series question
Projects
None yet
Development

No branches or pull requests

3 participants