Skip to content

Commit 95ef6db

Browse files
committed
Remove unused wrapper options
Also move our memory default to the beginning of NODE_OPTIONS so it can be overidden. The version of the flag with dashes seems to be the more correct one now so use that instead of underscores. Related: #2113.
1 parent 016daf2 commit 95ef6db

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/node/wrapper.ts

+2-13
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ class ChildProcess extends Process {
201201
}
202202
}
203203

204-
export interface WrapperOptions {
205-
maxMemory?: number
206-
nodeOptions?: string
207-
}
208-
209204
/**
210205
* Parent process wrapper that spawns the child process and performs a handshake
211206
* with it. Will relaunch the child if it receives a SIGUSR1 or is asked to by
@@ -224,7 +219,7 @@ export class ParentProcess extends Process {
224219

225220
private args?: DefaultedArgs
226221

227-
public constructor(private currentVersion: string, private readonly options?: WrapperOptions) {
222+
public constructor(private currentVersion: string) {
228223
super()
229224

230225
process.on("SIGUSR1", async () => {
@@ -310,18 +305,12 @@ export class ParentProcess extends Process {
310305
}
311306

312307
private spawn(): cp.ChildProcess {
313-
// Flags to pass along to the Node binary.
314-
let nodeOptions = `${process.env.NODE_OPTIONS || ""} ${(this.options && this.options.nodeOptions) || ""}`
315-
if (!/max_old_space_size=(\d+)/g.exec(nodeOptions)) {
316-
nodeOptions += ` --max_old_space_size=${(this.options && this.options.maxMemory) || 2048}`
317-
}
318-
319308
// Use spawn (instead of fork) to use the new binary in case it was updated.
320309
return cp.spawn(process.argv[0], process.argv.slice(1), {
321310
env: {
322311
...process.env,
323312
CODE_SERVER_PARENT_PID: process.pid.toString(),
324-
NODE_OPTIONS: nodeOptions,
313+
NODE_OPTIONS: `--max-old-space-size=2048 ${process.env.NODE_OPTIONS || ""}`,
325314
},
326315
stdio: ["ipc"],
327316
})

0 commit comments

Comments
 (0)