Skip to content

Commit

Permalink
try increases MaxMetaspace Kotlin/dokka#1405
Browse files Browse the repository at this point in the history
  • Loading branch information
aSemy committed Feb 17, 2023
1 parent 1805c44 commit f3fe5f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -93,9 +93,10 @@ abstract class DokkatooBasePlugin @Inject constructor(
target.tasks.withType<DokkatooGenerateTask>().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<DokkatooPrepareModuleDescriptorTask>().all task@{
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -58,16 +59,16 @@ abstract class DokkatooGenerateTask @Inject constructor(

/** @see JavaForkOptions.getDebug */
@get:Input
@get:Optional
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>

enum class GenerationType {
MODULE,
Expand Down Expand Up @@ -108,6 +109,7 @@ abstract class DokkatooGenerateTask @Inject constructor(
maxHeapSize = workerMinHeapSize.get()
enableAssertions = true
debug = workerDebugEnabled.get()
jvmArgs = workerJvmArgs.get()
}
}

Expand Down

0 comments on commit f3fe5f8

Please sign in to comment.