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

Add optional arguments to engine process #2665

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ object UtSettings : AbstractSettings(logger, defaultKeyForSettingsPath, defaultS
*/
var engineProcessLogConfigFile by getStringProperty("")

/**
* Optional arguments to the engine java process. One may want to
* increase heap size in order to give Soot more room for analysis.
*/
var engineProcessJavaOptionalArguments by getStringProperty("")

/**
* The property is useful only for the IntelliJ IDEs.
* If the property is set in true the engine process opens a debug port.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.utbot.framework.process

import org.utbot.common.osSpecificJavaExecutable
import org.utbot.framework.UtSettings
import org.utbot.framework.plugin.services.JdkInfoService
import org.utbot.rd.rdPortArgument
import java.io.File
Expand All @@ -26,12 +27,15 @@ abstract class AbstractRDProcessCompanion(
val debugArgument =
"-agentlib:jdwp=transport=dt_socket,server=n,suspend=${suspendValue},quiet=y,address=$debugPort"
.takeIf { runWithDebug }

add(javaExecutablePathString.pathString)
val javaVersionSpecificArgs = OpenModulesContainer.javaVersionSpecificArguments
if (javaVersionSpecificArgs.isNotEmpty()) {
addAll(javaVersionSpecificArgs)
}
UtSettings.engineProcessJavaOptionalArguments.split("\\s+".toRegex()).
takeIf {it.size > 1 || it[0].isNotEmpty() }?.forEach {
add(it)
}
debugArgument?.let { add(it) }
}
}