File tree 1 file changed +19
-0
lines changed
components/ide/jetbrains/image/status
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ func main() {
84
84
}
85
85
}
86
86
87
+ err = configureXmx (alias )
88
+ if err != nil {
89
+ log .WithError (err ).Error ("failed to configure backend Xmx" )
90
+ }
87
91
go run (wsInfo )
88
92
89
93
http .HandleFunc ("/joinLink" , func (w http.ResponseWriter , r * http.Request ) {
@@ -258,6 +262,21 @@ func remoteDevServerCmd(args []string) *exec.Cmd {
258
262
return cmd
259
263
}
260
264
265
+ func configureXmx (alias string ) error {
266
+ xmx := os .Getenv (strings .ToUpper (alias ) + "_XMX" )
267
+ if xmx == "" {
268
+ return nil
269
+ }
270
+ launcherPath := "/ide-desktop/backend/plugins/remote-dev-server/bin/launcher.sh"
271
+ content , err := ioutil .ReadFile (launcherPath )
272
+ if err != nil {
273
+ return err
274
+ }
275
+ // by default remote dev already set -Xmx2048m, see /ide-desktop/backend/plugins/remote-dev-server/bin/launcher.sh
276
+ newContent := strings .Replace (string (content ), "-Xmx2048m" , "-Xmx" + xmx , 1 )
277
+ return ioutil .WriteFile (launcherPath , []byte (newContent ), 0 )
278
+ }
279
+
261
280
/**
262
281
{
263
282
"buildNumber" : "221.4994.44",
You can’t perform that action at this time.
0 commit comments