Skip to content

Commit

Permalink
Use classloader isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored and aSemy committed Jan 9, 2024
1 parent 377e81d commit 189b35e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
10 changes: 0 additions & 10 deletions modules/dokkatoo-plugin/src/main/kotlin/DokkatooBasePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,7 @@ constructor(

target.tasks.withType<DokkatooGenerateTask>().configureEach {
cacheDirectory.convention(dokkatooExtension.dokkatooCacheDirectory)
workerDebugEnabled.convention(false)
workerLogFile.convention(temporaryDir.resolve("dokka-worker.log"))
workerJvmArgs.set(
listOf(
//"-XX:MaxMetaspaceSize=512m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+AlwaysPreTouch", // https://github.com/gradle/gradle/issues/3093#issuecomment-387259298
//"-XX:StartFlightRecording=disk=true,name={path.drop(1).map { if (it.isLetterOrDigit()) it else '-' }.joinToString("")},dumponexit=true,duration=30s",
//"-XX:FlightRecorderOptions=repository=$baseDir/jfr,stackdepth=512",
)
)
dokkaConfigurationJsonFile.convention(temporaryDir.resolve("dokka-configuration.json"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ constructor(
@get:Nested
val generator: DokkaGeneratorParametersSpec = objects.newInstance(pluginsConfiguration)

/** @see JavaForkOptions.getDebug */
@get:Input
abstract val workerDebugEnabled: Property<Boolean>
/** @see JavaForkOptions.getMinHeapSize */
@get:Input
@get:Optional
abstract val workerMinHeapSize: Property<String>
/** @see JavaForkOptions.getMaxHeapSize */
@get:Input
@get:Optional
abstract val workerMaxHeapSize: Property<String>
/** @see JavaForkOptions.jvmArgs */
@get:Input
abstract val workerJvmArgs: ListProperty<String>
@get:Internal
abstract val workerLogFile: RegularFileProperty

Expand All @@ -110,16 +96,8 @@ constructor(

logger.info("DokkaGeneratorWorker runtimeClasspath: ${runtimeClasspath.asPath}")

val workQueue = workers.processIsolation {
val workQueue = workers.classLoaderIsolation {
classpath.from(runtimeClasspath)
forkOptions {
defaultCharacterEncoding = "UTF-8"
minHeapSize = workerMinHeapSize.orNull
maxHeapSize = workerMaxHeapSize.orNull
enableAssertions = true
debug = workerDebugEnabled.get()
jvmArgs = workerJvmArgs.get()
}
}

workQueue.submit(DokkaGeneratorWorker::class) {
Expand Down

0 comments on commit 189b35e

Please sign in to comment.