File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ in stdenv.mkDerivation rec {
7575 makeWrapper ${ jdk } /bin/java $out/bin/jdt-language-server \
7676 --run "mkdir -p ${ runtimePath } " \
7777 --run "install -Dm 1777 -t ${ runtimePath } /config $out/share/config/*" \
78+ --run 'MEMORY_LIMIT_BYTES=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)' \
79+ --run 'MEMORY_LIMIT_MB=$(expr $MEMORY_LIMIT_BYTES / 1048576)' \
80+ --run 'LSP_MAX_HEAP=$(expr $MEMORY_LIMIT_MB / 4)' \
81+ --run 'LSP_MAX_HEAP=$(( $LSP_MAX_HEAP > 512 ? $LSP_MAX_HEAP : 512 ))' \
82+ --run 'export JAVA_OPTS="-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx${ "\ ${LSP_MAX_HEAP}" } m -Xms100m $JAVA_OPTS"' \
7883 --add-flags "-Declipse.application=org.eclipse.jdt.ls.core.id1" \
7984 --add-flags "-Dosgi.bundles.defaultStartLevel=4" \
8085 --add-flags "-Declipse.product=org.eclipse.jdt.ls.core.product" \
You can’t perform that action at this time.
0 commit comments