Skip to content

Instantly share code, notes, and snippets.

@odekopoon
Created August 15, 2020 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odekopoon/1bf8a4a4034254a57426b3222b3c3750 to your computer and use it in GitHub Desktop.
Save odekopoon/1bf8a4a4034254a57426b3222b3c3750 to your computer and use it in GitHub Desktop.
kkinnear/zprint with appcds (商用のOracle JDK8以外でどうなるか)
--- appcds 2020-08-16 00:15:45.000000000 +0900
+++ appcds-openjdk11 2020-08-16 00:38:43.000000000 +0900
@@ -100,14 +100,14 @@
echo "Creating loaded class list..."
-java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:off -XX:DumpLoadedClassList=zprint.filter.classlist -cp "$filter_path" zprint.main < helloworld.clj > /dev/null
+java -Xshare:off -XX:DumpLoadedClassList=zprint.filter.classlist -cp "$filter_path" zprint.main < helloworld.clj > /dev/null
echo "Creating loaded class cache from list..."
-java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:dump -XX:SharedClassListFile=zprint.filter.classlist -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main < helloworld.clj
+java -Xshare:dump -XX:SharedClassListFile=zprint.filter.classlist -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main < helloworld.clj
echo "Creating output command: $output_command_name"
echo "#!/bin/bash" > "$output_command_name"
-echo "java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:on -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main " '"${1//\\}"' >> "$output_command_name"
+echo "java -Xshare:on -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main " '"${1//\\}"' >> "$output_command_name"
chmod +x "$output_command_name"
--- appcds 2020-08-16 00:15:45.000000000 +0900
+++ appcds-openjdk8 2020-08-16 00:19:01.000000000 +0900
@@ -100,14 +100,14 @@
echo "Creating loaded class list..."
-java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:off -XX:DumpLoadedClassList=zprint.filter.classlist -cp "$filter_path" zprint.main < helloworld.clj > /dev/null
+java -Xshare:off -XX:DumpLoadedClassList=zprint.filter.classlist -cp "$filter_path" zprint.main < helloworld.clj > /dev/null
echo "Creating loaded class cache from list..."
-java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:dump -XX:SharedClassListFile=zprint.filter.classlist -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main < helloworld.clj
+java -Xshare:dump -XX:+UnlockDiagnosticVMOptions -XX:SharedClassListFile=zprint.filter.classlist -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main < helloworld.clj
echo "Creating output command: $output_command_name"
echo "#!/bin/bash" > "$output_command_name"
-echo "java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:on -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main " '"${1//\\}"' >> "$output_command_name"
+echo "java -Xshare:on -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile="$current_path/zprint.filter.cache" -cp "$filter_path" zprint.main " '"${1//\\}"' >> "$output_command_name"
chmod +x "$output_command_name"
https://github.com/kkinnear/zprint/blob/master/doc/getting/appcds.md
Oracle JDK8向け
https://github.com/kkinnear/zprint/blob/1.0.0/appcds
・OpenJDK8で試すと
UseAppCDSが使えないため、効果は少しだけ
https://kagamihoge.hatenablog.com/entry/2019/05/17/204559
appcds-openjdk8.patch
・OpenJDK11
> OpenJDK 64-Bit Server VM warning: Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled
JDK10あたりから、JDK6以前のバイトコードがCDSできなくなってる。
> OpenJDK 64-Bit Server VM warning: Pre JDK 6 class not supported by CDS: 49.0 zprint/main
> Preload Warning: Cannot find zprint/main
> OpenJDK 64-Bit Server VM warning: Pre JDK 6 class not supported by CDS: 49.0 clojure/core__init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment