Skip to content

Commit

Permalink
use breadth-first dependency collector impl
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Zhang <yanzh@microsoft.com>
  • Loading branch information
Eskibear committed Mar 31, 2023
1 parent 09e2c83 commit 33a8f1f
Showing 1 changed file with 16 additions and 5 deletions.
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

0 comments on commit 33a8f1f

Please sign in to comment.