Skip to content

Commit

Permalink
[supervisor] Set JAVA_TOOL_OPTIONS to curb RAM
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel authored and roboquat committed Aug 4, 2021
1 parent 29007fd commit 8c2894f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ func buildChildProcEnv(cfg *Config) []string {
envs["HOME"] = "/home/gitpod"
envs["USER"] = "gitpod"

// Particular Java optimisation: Java pre v10 did not gauge it's available memory correctly, and needed explicitly setting "-Xmx" for all Hotspot/openJDK VMs
envs["JAVA_TOOL_OPTIONS"] += fmt.Sprintf(" -Xmx%sm", os.Getenv("GITPOD_MEMORY"))

var env, envn []string
for nme, val := range envs {
log.WithField("envvar", nme).Debug("passing environment variable to IDE")
Expand Down

0 comments on commit 8c2894f

Please sign in to comment.