aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/admin/jvm/xx_options.go
blob: ea984df1dfe1dd38166cf8479a9fc75e5aae1c7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej

package jvm

import (
	"github.com/vespa-engine/vespa/client/go/internal/admin/defaults"
)

func (opts *Options) AddCommonXX() {
	crashDir := defaults.UnderVespaHome("var/crash")
	errorFile := crashDir + "/hs_err_pid%p.log"
	opts.fixSpec.FixDir(crashDir)
	opts.AddOption("-XX:+PreserveFramePointer")
	opts.AddOption("-XX:+HeapDumpOnOutOfMemoryError")
	opts.AddOption("-XX:HeapDumpPath=" + crashDir)
	opts.AddOption("-XX:ErrorFile=" + errorFile)
	opts.AddOption("-XX:+ExitOnOutOfMemoryError")
	// not common after all:
	opts.AddOption("-XX:MaxJavaStackTraceDepth=1000000")
}