@@ -169,7 +169,47 @@ $ ls -l JavacBenchApp.cds*
169
169
170
170
Note that the ` JavacBenchApp.cds.code ` file is no longer created.
171
171
172
- ## 4. Benchmarking
172
+ ## 4. Limitations of the Leyden Prototype
173
+
174
+ When trying out the Leyden, please pay attention to the following limitations.
175
+
176
+ ### Only the G1 collector is supported
177
+
178
+ G1 is the default collector used by the JDK. Many of the optimizations in the Leyden only work with G1.
179
+
180
+ A collector other than G1 may be used under the following conditions:
181
+
182
+ - You have explicitly specified a different collector, e.g., ` -XX:+UseSerialGC ` ; or
183
+ - You are using a container that has a very small amount of memory. As a result, the JVM automatically
184
+ picks a different collector such as Serial.
185
+
186
+ In these cases, you can run into the following problems:
187
+
188
+ (a) During the training run, you will see an error like this, and the CDS archive will not be created:
189
+
190
+ ```
191
+ $ rm -fv JavacBenchApp.cds*
192
+ $ java -XX:CacheDataStore=JavacBenchApp.cds -XX:+UseSerialGC -cp JavacBenchApp.jar JavacBenchApp 50
193
+ Error occurred during initialization of VM
194
+ (Temporary) Cannot create the CacheDataStore: -XX:UseG1GC must be specified
195
+ ```
196
+
197
+ (b) During the production run, you will see an error like the following. The CDS archive will
198
+ not be loaded. As a result, your application will not benefit from the Leyden optimizations:
199
+
200
+
201
+ ```
202
+ $ ls -l JavacBenchApp.cds*
203
+ -r--r--r-- 1 iklam iklam 30900224 May 20 19:21 JavacBenchApp.cds
204
+ -r--r--r-- 1 iklam iklam 16895736 May 20 19:21 JavacBenchApp.cds.code
205
+ $ java -XX:CacheDataStore=JavacBenchApp.cds -cp JavacBenchApp.jar JavacBenchApp 50
206
+ Generated source code for 51 classes and compiled them in 423 ms
207
+ $ java -XX:CacheDataStore=JavacBenchApp.cds -cp JavacBenchApp.jar -XX:+UseSerialGC JavacBenchApp 50
208
+ [0.180s][error][cds] CDS archive has preloaded classes. It cannot be used because GC used during dump time (G1) is not the same as runtime (Serial)
209
+ Generated source code for 51 classes and compiled them in 890 ms
210
+ ```
211
+
212
+ ## 5. Benchmarking
173
213
174
214
We use a small set of benchmarks to demonstrate the performance of the optimizations in the Leyden repo.
175
215
@@ -340,6 +380,6 @@ gantt
340
380
premain CDS + AOT : 0, 368
341
381
```
342
382
343
- ## 5 . More Documentation
383
+ ## 6 . More Documentation
344
384
345
385
Please see [ test/hotspot/jtreg/premain/] ( test/hotspot/jtreg/premain ) for more information.
0 commit comments