Code Monkey home page Code Monkey logo

Comments (9)

TimvdLippe avatar TimvdLippe commented on September 25, 2024 1

All right. The failures were related to some internal changes I had to make. Fortunately I was able to run with the assistance of a colleague.

Some data:

  1. The generated debug.log was 16GB
  2. The configuration cache itself is 203MB
  3. With minified output to strip out only tasks, the speedscope.json is 1.1MB
  4. I had to anonymize the data before I could upload it to speedscope.app. Therefore, I had to manually map back to our internal module names and tasks
  5. The number of modules in this particular build is about 1000

With an eyeball look (since we have loads and loads of modules), I was able to see that some tasks stood out:

  1. graphViewMain which is 115Kb for a relatively small module
  2. Same for graphViewTest which is 175KB for that same module
  3. We see the same graphView for each of our sourcesets
  4. For some of the largest sourcesets, I see that each graphViewX takes 1MB and we have about 5 of these, so 5MB per module

Other tasks are also large, but at least from a first glance graphViewX appears to be the culprit. When I omit the data for all these, we are still looking at a large number, but maybe the findings from this task can help us with the rest as well.

from dependency-analysis-gradle-plugin.

TimvdLippe avatar TimvdLippe commented on September 25, 2024 1

This is the workaround I used if anybody else runs into this issue:

import com.autonomousapps.tasks.GraphViewTask

project.getPluginManager().withPlugin('com.autonomousapps.dependency-analysis', { plugin ->
    project.getTasks().withType(GraphViewTask).configureEach {
        it.notCompatibleWithConfigurationCache("https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/1098")
    }
}

from dependency-analysis-gradle-plugin.

mlopatkin avatar mlopatkin commented on September 25, 2024

There's a viewer for the configuration cache data: https://github.com/gradle/gcc2speedscope, which may give some insights into what is being stored. @TimvdLippe could you please try that?

from dependency-analysis-gradle-plugin.

TimvdLippe avatar TimvdLippe commented on September 25, 2024

I will need security approval to run such tooling, so it will take me a couple of days to do so, but will do 👍

Is there a workaround to disable the configuration cache for the task anyways? I think we can mark it as incompatible ourselves, as we are an outlier in terms of codebase size and then we can wait for a potential fix.

from dependency-analysis-gradle-plugin.

mlopatkin avatar mlopatkin commented on September 25, 2024

Is there a workaround to disable the configuration cache for the task anyways?

There's Task.notCompatibleWithConfigurationCache, you can look how Gradle itself uses it for a similar purpose. This should be enough to at least prevent loading the cache. I'm not sure if it also disables storing the graph (Gradle still checks for CC errors coming from other tasks), but that's the best option I know of.

from dependency-analysis-gradle-plugin.

TimvdLippe avatar TimvdLippe commented on September 25, 2024

I was able to clone the project and build it. Unfortunately I am running into runtime issues with a Suppressed: kotlinx.coroutines.channels.ClosedReceiveChannelException: Channel was closed and later a Caused by: java.lang.ClassNotFoundException: gcc2speedscope.EventStore$queryProfiles$1. I lack Kotlin knowledge and am not sure if these are pre-existing issues or related to our internal infrastructure. Will try to debug further with a colleague who has knowledge on Kotlin

from dependency-analysis-gradle-plugin.

TimvdLippe avatar TimvdLippe commented on September 25, 2024

Looking at the PR in question, I wonder why we annotated compileFiles and runtimeFiles as @InputFiles? In our internal plugins, we have some tasks that also operate on our classpaths, but they don't have such a large configuration input. Instead, they operate on a @Classpath and we retrieve the files during task execution. Since we already have the runtimeClassPath property, shouldn't we annotate that property with @Classpath and then retrieve the files?

Example from our internal plugin that afaik doesn't have the same configuration cache size hit:

    @Classpath
    public abstract ConfigurableFileCollection getSourcesClasspath();

from dependency-analysis-gradle-plugin.

TimvdLippe avatar TimvdLippe commented on September 25, 2024

@mlopatkin Is that sufficient information for you or do you want me to run anything else?

from dependency-analysis-gradle-plugin.

TimvdLippe avatar TimvdLippe commented on September 25, 2024

To unblock our upgrade, we will mark the graphView tasks as incompatible with the configuration cache. Hopefully in the future the situation improves and we can use the configuration cache again for these tasks.

from dependency-analysis-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.