Skip to content
Merged
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
21 changes: 16 additions & 5 deletions src/javaServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ const DEBUG = (typeof v8debug === 'object') || startedInDebugMode();
/**
* Argument that tells the program where to generate the heap dump that is created when an OutOfMemoryError is raised and `HEAP_DUMP` has been passed
*/
export const HEAP_DUMP_LOCATION = '-XX:HeapDumpPath=';
export const HEAP_DUMP_LOCATION = '-XX:HeapDumpPath=';

/**
* Argument that tells the program to generate a heap dump file when an OutOfMemoryError is raised
*/
export const HEAP_DUMP = '-XX:+HeapDumpOnOutOfMemoryError';
/**
* Argument that tells the program to generate a heap dump file when an OutOfMemoryError is raised
*/
export const HEAP_DUMP = '-XX:+HeapDumpOnOutOfMemoryError';

/**
* Argument that specifies name of the dependency collector implementation to use.
* `df` for depth-first and `bf` for breadth-first.
* See: https://github.com/apache/maven-resolver/blob/maven-resolver-1.9.7/src/site/markdown/configuration.md
*/
const DEPENDENCY_COLLECTOR_IMPL= '-Daether.dependencyCollector.impl=';
const DEPENDENCY_COLLECTOR_IMPL_BF= 'bf';

export function prepareExecutable(requirements: RequirementsData, workspacePath, javaConfig, context: ExtensionContext, isSyntaxServer: boolean): Executable {
const executable: Executable = Object.create(null);
Expand Down Expand Up @@ -130,6 +138,9 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp
if (vmargs.indexOf(HEAP_DUMP_LOCATION) < 0) {
params.push(`${HEAP_DUMP_LOCATION}${path.dirname(workspacePath)}`);
}
if (vmargs.indexOf(DEPENDENCY_COLLECTOR_IMPL) < 0) {
params.push(`${DEPENDENCY_COLLECTOR_IMPL}${DEPENDENCY_COLLECTOR_IMPL_BF}`);
}

const sharedIndexLocation: string = resolveIndexCache(context);
if (sharedIndexLocation) {
Expand Down