diff --git a/modules/dokkatoo-plugin/src/main/kotlin/DokkatooBasePlugin.kt b/modules/dokkatoo-plugin/src/main/kotlin/DokkatooBasePlugin.kt index f501b4c9..81fe8313 100644 --- a/modules/dokkatoo-plugin/src/main/kotlin/DokkatooBasePlugin.kt +++ b/modules/dokkatoo-plugin/src/main/kotlin/DokkatooBasePlugin.kt @@ -93,9 +93,10 @@ abstract class DokkatooBasePlugin @Inject constructor( target.tasks.withType().configureEach { cacheDirectory.convention(dokkatooExtension.dokkatooCacheDirectory) workerDebugEnabled.convention(false) - // increase memory - DokkaGenerator is hungry + // increase memory - DokkaGenerator is hungry https://github.com/Kotlin/dokka/issues/1405 workerMinHeapSize.convention("256m") workerMaxHeapSize.convention("1g") + workerJvmArgs.set(listOf("-XX:MaxMetaspaceSize=512m")) } target.tasks.withType().all task@{ diff --git a/modules/dokkatoo-plugin/src/main/kotlin/tasks/DokkatooGenerateTask.kt b/modules/dokkatoo-plugin/src/main/kotlin/tasks/DokkatooGenerateTask.kt index 4d092c17..7288b301 100644 --- a/modules/dokkatoo-plugin/src/main/kotlin/tasks/DokkatooGenerateTask.kt +++ b/modules/dokkatoo-plugin/src/main/kotlin/tasks/DokkatooGenerateTask.kt @@ -9,6 +9,7 @@ import kotlinx.serialization.json.decodeFromStream import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.api.tasks.PathSensitivity.NAME_ONLY @@ -58,16 +59,16 @@ abstract class DokkatooGenerateTask @Inject constructor( /** @see JavaForkOptions.getDebug */ @get:Input - @get:Optional abstract val workerDebugEnabled: Property /** @see JavaForkOptions.getMinHeapSize */ @get:Input - @get:Optional abstract val workerMinHeapSize: Property /** @see JavaForkOptions.getMaxHeapSize */ @get:Input - @get:Optional abstract val workerMaxHeapSize: Property + /** @see JavaForkOptions.jvmArgs */ + @get:Input + abstract val workerJvmArgs: ListProperty enum class GenerationType { MODULE, @@ -108,6 +109,7 @@ abstract class DokkatooGenerateTask @Inject constructor( maxHeapSize = workerMinHeapSize.get() enableAssertions = true debug = workerDebugEnabled.get() + jvmArgs = workerJvmArgs.get() } }