2
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
26
import java.io.BufferedInputStream;
27
import java.io.FileInputStream;
28
import java.io.IOException;
29
import java.io.InputStream;
31
import java.nio.charset.Charset;
32
import java.nio.file.Files;
33
import java.nio.file.Path;
34
import java.nio.file.Paths;
35
import java.nio.file.StandardOpenOption;
36
import java.time.Instant;
37
import java.util.ArrayList;
38
import java.util.Collections;
39
import java.util.HashMap;
42
import java.util.Properties;
44
import java.util.concurrent.Callable;
45
import java.util.concurrent.TimeUnit;
46
import java.util.function.Predicate;
47
import java.util.function.Supplier;
48
import java.util.regex.Matcher;
49
import java.util.regex.Pattern;
50
import java.util.stream.Stream;
52
import jdk.internal.foreign.CABI;
53
import jdk.test.whitebox.code.Compiler;
54
import jdk.test.whitebox.cpuinfo.CPUInfo;
55
import jdk.test.whitebox.gc.GC;
56
import jdk.test.whitebox.WhiteBox;
57
import jdk.test.lib.Platform;
58
import jdk.test.lib.Container;
61
* The Class to be invoked by jtreg prior Test Suite execution to
62
* collect information about VM.
63
* Do not use any APIs that may not be available in all target VMs.
64
* Properties set by this Class will be available in the @requires expressions.
66
public class VMProps implements Callable<Map<String, String>> {
67
// value known to jtreg as an indicator of error state
68
private static final String ERROR_STATE = "__ERROR__";
70
private static final String GC_PREFIX = "-XX:+Use";
71
private static final String GC_SUFFIX = "GC";
73
private static final WhiteBox WB = WhiteBox.getWhiteBox();
75
private static class SafeMap {
76
private final Map<String, String> map = new HashMap<>();
78
public void put(String key, Supplier<String> s) {
82
} catch (Throwable t) {
83
System.err.println("failed to get value for " + key);
84
t.printStackTrace(System.err);
85
value = ERROR_STATE + t;
92
* Collects information about VM properties.
93
* This method will be invoked by jtreg.
95
* @return Map of property-value pairs.
98
public Map<String, String> call() {
99
log("Entering call()");
100
SafeMap map = new SafeMap();
101
map.put("vm.flavor", this::vmFlavor);
102
map.put("vm.compMode", this::vmCompMode);
103
map.put("vm.bits", this::vmBits);
104
map.put("vm.flightRecorder", this::vmFlightRecorder);
105
map.put("vm.simpleArch", this::vmArch);
106
map.put("vm.debug", this::vmDebug);
107
map.put("vm.jvmci", this::vmJvmci);
108
map.put("vm.jvmci.enabled", this::vmJvmciEnabled);
109
map.put("vm.emulatedClient", this::vmEmulatedClient);
110
// vm.hasSA is "true" if the VM contains the serviceability agent
112
map.put("vm.hasSA", this::vmHasSA);
113
// vm.hasJFR is "true" if JFR is included in the build of the VM and
114
// so tests can be executed.
115
map.put("vm.hasJFR", this::vmHasJFR);
116
map.put("vm.hasDTrace", this::vmHasDTrace);
117
map.put("vm.jvmti", this::vmHasJVMTI);
118
map.put("vm.cpu.features", this::cpuFeatures);
119
map.put("vm.pageSize", this::vmPageSize);
120
map.put("vm.rtm.cpu", this::vmRTMCPU);
121
map.put("vm.rtm.compiler", this::vmRTMCompiler);
122
// vm.cds is true if the VM is compiled with cds support.
123
map.put("vm.cds", this::vmCDS);
124
map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders);
125
map.put("vm.cds.write.archived.java.heap", this::vmCDSCanWriteArchivedJavaHeap);
126
map.put("vm.continuations", this::vmContinuations);
127
// vm.graal.enabled is true if Graal is used as JIT
128
map.put("vm.graal.enabled", this::isGraalEnabled);
129
// jdk.hasLibgraal is true if the libgraal shared library file is present
130
map.put("jdk.hasLibgraal", this::hasLibgraal);
131
// vm.libgraal.enabled is true if libgraal is used as JIT
132
map.put("vm.libgraal.enabled", this::isLibgraalEnabled);
133
map.put("vm.compiler1.enabled", this::isCompiler1Enabled);
134
map.put("vm.compiler2.enabled", this::isCompiler2Enabled);
135
map.put("docker.support", this::dockerSupport);
136
map.put("vm.musl", this::isMusl);
137
map.put("release.implementor", this::implementor);
138
map.put("jdk.containerized", this::jdkContainerized);
139
map.put("vm.flagless", this::isFlagless);
140
map.put("jdk.foreign.linker", this::jdkForeignLinker);
141
vmGC(map); // vm.gc.X = true/false
142
vmGCforCDS(map); // may set vm.gc
143
vmOptFinalFlags(map);
146
log("Leaving call()");
151
* Print a stack trace before returning error state;
152
* Used by the various helper functions which parse information from
153
* VM properties in the case where they don't find an expected property
154
* or a property doesn't conform to an expected format.
156
* @return {@link #ERROR_STATE}
158
private String errorWithMessage(String message) {
159
new Exception(message).printStackTrace();
160
return ERROR_STATE + message;
164
* @return vm.simpleArch value of "os.simpleArch" property of tested JDK.
166
protected String vmArch() {
167
String arch = System.getProperty("os.arch");
168
if (arch.equals("x86_64") || arch.equals("amd64")) {
170
} else if (arch.contains("86")) {
178
* @return VM type value extracted from the "java.vm.name" property.
180
protected String vmFlavor() {
181
// E.g. "Java HotSpot(TM) 64-Bit Server VM"
182
String vmName = System.getProperty("java.vm.name");
183
if (vmName == null) {
184
return errorWithMessage("Can't get 'java.vm.name' property");
187
Pattern startP = Pattern.compile(".* (\\S+) VM");
188
Matcher m = startP.matcher(vmName);
190
return m.group(1).toLowerCase();
192
return errorWithMessage("Can't get VM flavor from 'java.vm.name'");
196
* @return VM compilation mode extracted from the "java.vm.info" property.
198
protected String vmCompMode() {
200
String vmInfo = System.getProperty("java.vm.info");
201
if (vmInfo == null) {
202
return errorWithMessage("Can't get 'java.vm.info' property");
204
vmInfo = vmInfo.toLowerCase();
205
if (vmInfo.contains("mixed mode")) {
207
} else if (vmInfo.contains("compiled mode")) {
209
} else if (vmInfo.contains("interpreted mode")) {
212
return errorWithMessage("Can't get compilation mode from 'java.vm.info'");
217
* @return VM bitness, the value of the "sun.arch.data.model" property.
219
protected String vmBits() {
220
String dataModel = System.getProperty("sun.arch.data.model");
221
if (dataModel != null) {
224
return errorWithMessage("Can't get 'sun.arch.data.model' property");
229
* @return "true" if Flight Recorder is enabled, "false" if is disabled.
231
protected String vmFlightRecorder() {
232
Boolean isFlightRecorder = WB.getBooleanVMFlag("FlightRecorder");
233
String startFROptions = WB.getStringVMFlag("StartFlightRecording");
234
if (isFlightRecorder != null && isFlightRecorder) {
237
if (startFROptions != null && !startFROptions.isEmpty()) {
244
* @return debug level value extracted from the "jdk.debug" property.
246
protected String vmDebug() {
247
String debug = System.getProperty("jdk.debug");
249
return "" + debug.contains("debug");
251
return errorWithMessage("Can't get 'jdk.debug' property");
256
* @return true if VM supports JVMCI and false otherwise
258
protected String vmJvmci() {
259
// builds with jvmci have this flag
260
if (WB.getBooleanVMFlag("EnableJVMCI") == null) {
264
// Not all GCs have full JVMCI support
265
if (!WB.isJVMCISupportedByGC()) {
269
// Interpreted mode cannot enable JVMCI
270
if (vmCompMode().equals("Xint")) {
279
* @return true if JVMCI is enabled
281
protected String vmJvmciEnabled() {
282
// builds with jvmci have this flag
283
if ("false".equals(vmJvmci())) {
287
return "" + Compiler.isJVMCIEnabled();
292
* @return true if VM runs in emulated-client mode and false otherwise.
294
protected String vmEmulatedClient() {
295
String vmInfo = System.getProperty("java.vm.info");
296
if (vmInfo == null) {
297
return errorWithMessage("Can't get 'java.vm.info' property");
299
return "" + vmInfo.contains(" emulated-client");
303
* @return supported CPU features
305
protected String cpuFeatures() {
306
return CPUInfo.getFeatures().toString();
310
* For all existing GC sets vm.gc.X property.
311
* Example vm.gc.G1=true means:
313
* User either set G1 explicitely (-XX:+UseG1GC) or did not set any GC
314
* G1 can be selected, i.e. it doesn't conflict with other VM flags
316
* @param map - property-value pairs
318
protected void vmGC(SafeMap map) {
319
var isJVMCIEnabled = Compiler.isJVMCIEnabled();
320
Predicate<GC> vmGCProperty = (GC gc) -> (gc.isSupported()
321
&& (!isJVMCIEnabled || gc.isSupportedByJVMCICompiler())
322
&& (gc.isSelected() || GC.isSelectedErgonomically()));
323
for (GC gc: GC.values()) {
324
map.put("vm.gc." + gc.name(), () -> "" + vmGCProperty.test(gc));
327
// Special handling for ZGC modes
328
var vmGCZ = vmGCProperty.test(GC.Z);
329
var genZ = WB.getBooleanVMFlag("ZGenerational");
330
var genZIsDefault = WB.isDefaultVMFlag("ZGenerational");
331
// vm.gc.ZGenerational=true means:
332
// vm.gc.Z is true and ZGenerational is either explicitly true, or default
333
map.put("vm.gc.ZGenerational", () -> "" + (vmGCZ && (genZ || genZIsDefault)));
334
// vm.gc.ZSinglegen=true means:
335
// vm.gc.Z is true and ZGenerational is either explicitly false, or default
336
map.put("vm.gc.ZSinglegen", () -> "" + (vmGCZ && (!genZ || genZIsDefault)));
340
* "jtreg -vmoptions:-Dtest.cds.runtime.options=..." can be used to specify
341
* the GC type to be used when running with a CDS archive. Set "vm.gc" accordingly,
342
* so that tests that need to explicitly choose the GC type can be excluded
343
* with "@requires vm.gc == null".
345
* @param map - property-value pairs
347
protected void vmGCforCDS(SafeMap map) {
348
if (!GC.isSelectedErgonomically()) {
349
// The GC has been explicitly specified on the command line, so
350
// jtreg will set the "vm.gc" property. Let's not interfere with it.
354
String jtropts = System.getProperty("test.cds.runtime.options");
355
if (jtropts != null) {
356
for (String opt : jtropts.split(",")) {
357
if (opt.startsWith(GC_PREFIX) && opt.endsWith(GC_SUFFIX)) {
358
String gc = opt.substring(GC_PREFIX.length(), opt.length() - GC_SUFFIX.length());
359
map.put("vm.gc", () -> gc);
366
* Selected final flag.
368
* @param map - property-value pairs
369
* @param flagName - flag name
371
private void vmOptFinalFlag(SafeMap map, String flagName) {
372
map.put("vm.opt.final." + flagName,
373
() -> String.valueOf(WB.getBooleanVMFlag(flagName)));
377
* Selected sets of final flags.
379
* @param map - property-value pairs
381
protected void vmOptFinalFlags(SafeMap map) {
382
vmOptFinalFlag(map, "ClassUnloading");
383
vmOptFinalFlag(map, "ClassUnloadingWithConcurrentMark");
384
vmOptFinalFlag(map, "CriticalJNINatives");
385
vmOptFinalFlag(map, "EnableJVMCI");
386
vmOptFinalFlag(map, "EliminateAllocations");
387
vmOptFinalFlag(map, "UseCompressedOops");
388
vmOptFinalFlag(map, "UseVectorizedMismatchIntrinsic");
389
vmOptFinalFlag(map, "ZGenerational");
393
* @return "true" if VM has a serviceability agent.
395
protected String vmHasSA() {
396
return "" + Platform.hasSA();
400
* @return "true" if the VM is compiled with Java Flight Recorder (JFR)
403
protected String vmHasJFR() {
404
return "" + WB.isJFRIncluded();
408
* @return "true" if the VM is compiled with JVMTI
410
protected String vmHasJVMTI() {
411
return "" + WB.isJVMTIIncluded();
415
* @return "true" if the VM is compiled with DTrace
417
protected String vmHasDTrace() {
418
return "" + WB.isDTraceIncluded();
422
* @return "true" if compiler in use supports RTM and "false" otherwise.
423
* Note: Lightweight locking does not support RTM (for now).
425
protected String vmRTMCompiler() {
426
boolean isRTMCompiler = false;
428
if (Compiler.isC2Enabled() &&
429
(Platform.isX86() || Platform.isX64() || Platform.isPPC()) &&
430
is_LM_LIGHTWEIGHT().equals("false")) {
431
isRTMCompiler = true;
433
return "" + isRTMCompiler;
437
* @return true if VM runs RTM supported CPU and false otherwise.
439
protected String vmRTMCPU() {
440
return "" + CPUInfo.hasFeature("rtm");
444
* Check for CDS support.
446
* @return true if CDS is supported by the VM to be tested.
448
protected String vmCDS() {
449
return "" + WB.isCDSIncluded();
453
* Check for CDS support for custom loaders.
455
* @return true if CDS provides support for customer loader in the VM to be tested.
457
protected String vmCDSForCustomLoaders() {
458
return "" + ("true".equals(vmCDS()) && Platform.areCustomLoadersSupportedForCDS());
462
* @return true if this VM can write Java heap objects into the CDS archive
464
protected String vmCDSCanWriteArchivedJavaHeap() {
465
return "" + ("true".equals(vmCDS()) && WB.canWriteJavaHeapArchive()
466
&& isCDSRuntimeOptionsCompatible());
470
* @return true if the VM options specified via the "test.cds.runtime.options"
471
* property is compatible with writing Java heap objects into the CDS archive
473
protected boolean isCDSRuntimeOptionsCompatible() {
474
String jtropts = System.getProperty("test.cds.runtime.options");
475
if (jtropts == null) {
478
String CCP_DISABLED = "-XX:-UseCompressedClassPointers";
479
String G1GC_ENABLED = "-XX:+UseG1GC";
480
for (String opt : jtropts.split(",")) {
481
if (opt.equals(CCP_DISABLED)) {
484
if (opt.startsWith(GC_PREFIX) && opt.endsWith(GC_SUFFIX) &&
485
!opt.equals(G1GC_ENABLED)) {
493
* @return "true" if this VM supports continuations.
495
protected String vmContinuations() {
496
if (WB.getBooleanVMFlag("VMContinuations")) {
504
* @return System page size in bytes.
506
protected String vmPageSize() {
507
return "" + WB.getVMPageSize();
511
* @return LockingMode.
513
protected String vmLockingMode() {
514
return "" + WB.getIntVMFlag("LockingMode");
518
* @return "true" if LockingMode == 0 (LM_MONITOR)
520
protected String is_LM_MONITOR() {
521
return "" + vmLockingMode().equals("0");
525
* @return "true" if LockingMode == 1 (LM_LEGACY)
527
protected String is_LM_LEGACY() {
528
return "" + vmLockingMode().equals("1");
532
* @return "true" if LockingMode == 2 (LM_LIGHTWEIGHT)
534
protected String is_LM_LIGHTWEIGHT() {
535
return "" + vmLockingMode().equals("2");
539
* Check if Graal is used as JIT compiler.
541
* @return true if Graal is used as JIT compiler.
543
protected String isGraalEnabled() {
544
return "" + Compiler.isGraalEnabled();
548
* Check if the libgraal shared library file is present.
550
* @return true if the libgraal shared library file is present.
552
protected String hasLibgraal() {
553
return "" + WB.hasLibgraal();
557
* Check if libgraal is used as JIT compiler.
559
* @return true if libgraal is used as JIT compiler.
561
protected String isLibgraalEnabled() {
562
return "" + Compiler.isLibgraalEnabled();
566
* Check if Compiler1 is present.
568
* @return true if Compiler1 is used as JIT compiler, either alone or as part of the tiered system.
570
protected String isCompiler1Enabled() {
571
return "" + Compiler.isC1Enabled();
575
* Check if Compiler2 is present.
577
* @return true if Compiler2 is used as JIT compiler, either alone or as part of the tiered system.
579
protected String isCompiler2Enabled() {
580
return "" + Compiler.isC2Enabled();
584
* A simple check for docker support
586
* @return true if docker is supported in a given environment
588
protected String dockerSupport() {
589
log("Entering dockerSupport()");
591
boolean isSupported = false;
592
if (Platform.isLinux()) {
593
// currently docker testing is only supported for Linux,
594
// on certain platforms
596
String arch = System.getProperty("os.arch");
598
if (Platform.isX64()) {
600
} else if (Platform.isAArch64()) {
602
} else if (Platform.isS390x()) {
604
} else if (arch.equals("ppc64le")) {
609
log("dockerSupport(): platform check: isSupported = " + isSupported);
613
isSupported = checkDockerSupport();
614
} catch (Exception e) {
619
log("dockerSupport(): returning isSupported = " + isSupported);
620
return "" + isSupported;
623
// Configures process builder to redirect process stdout and stderr to a file.
624
// Returns file names for stdout and stderr.
625
private Map<String, String> redirectOutputToLogFile(String msg, ProcessBuilder pb, String fileNameBase) {
626
Map<String, String> result = new HashMap<>();
627
String timeStamp = Instant.now().toString().replace(":", "-").replace(".", "-");
629
String stdoutFileName = String.format("./%s-stdout--%s.log", fileNameBase, timeStamp);
630
pb.redirectOutput(new File(stdoutFileName));
631
log(msg + ": child process stdout redirected to " + stdoutFileName);
632
result.put("stdout", stdoutFileName);
634
String stderrFileName = String.format("./%s-stderr--%s.log", fileNameBase, timeStamp);
635
pb.redirectError(new File(stderrFileName));
636
log(msg + ": child process stderr redirected to " + stderrFileName);
637
result.put("stderr", stderrFileName);
642
private void printLogfileContent(Map<String, String> logFileNames) {
643
logFileNames.entrySet().stream()
646
log("------------- " + entry.getKey());
648
Files.lines(Path.of(entry.getValue()))
649
.forEach(line -> log(line));
650
} catch (IOException ie) {
651
log("Exception while reading file: " + ie);
653
log("-------------");
657
private boolean checkDockerSupport() throws IOException, InterruptedException {
658
log("checkDockerSupport(): entering");
659
ProcessBuilder pb = new ProcessBuilder("which", Container.ENGINE_COMMAND);
660
Map<String, String> logFileNames =
661
redirectOutputToLogFile("checkDockerSupport(): which " + Container.ENGINE_COMMAND,
662
pb, "which-container");
663
Process p = pb.start();
664
p.waitFor(10, TimeUnit.SECONDS);
665
int exitValue = p.exitValue();
667
log(String.format("checkDockerSupport(): exitValue = %s, pid = %s", exitValue, p.pid()));
668
if (exitValue != 0) {
669
printLogfileContent(logFileNames);
672
return (exitValue == 0);
678
* @return true if musl libc is used.
680
protected String isMusl() {
681
return Boolean.toString(WB.getLibcName().contains("musl"));
684
private String implementor() {
685
try (InputStream in = new BufferedInputStream(new FileInputStream(
686
System.getProperty("java.home") + "/release"))) {
687
Properties properties = new Properties();
689
String implementorProperty = properties.getProperty("IMPLEMENTOR");
690
if (implementorProperty != null) {
691
return implementorProperty.replace("\"", "");
693
return errorWithMessage("Can't get 'IMPLEMENTOR' property from 'release' file");
694
} catch (IOException e) {
696
return errorWithMessage("Failed to read 'release' file " + e);
700
private String jdkContainerized() {
701
String isEnabled = System.getenv("TEST_JDK_CONTAINERIZED");
702
return "" + "true".equalsIgnoreCase(isEnabled);
706
* Checks if we are in <i>almost</i> out-of-box configuration, i.e. the flags
707
* which JVM is started with don't affect its behavior "significantly".
708
* {@code TEST_VM_FLAGLESS} enviroment variable can be used to force this
709
* method to return true or false and allow or reject any flags.
711
* @return true if there are no JVM flags
713
private String isFlagless() {
714
boolean result = true;
715
String flagless = System.getenv("TEST_VM_FLAGLESS");
716
if (flagless != null) {
717
return "" + "true".equalsIgnoreCase(flagless);
720
List<String> allFlags = allFlags().toList();
723
var ignoredXXFlags = Set.of(
724
// added by run-test framework
726
// added by test environment
727
"CreateCoredumpOnCrash"
729
result &= allFlags.stream()
730
.filter(s -> s.startsWith("-XX:"))
733
.map(s -> s.substring(4))
734
// remove +/- from bool flags
735
.map(s -> s.charAt(0) == '+' || s.charAt(0) == '-' ? s.substring(1) : s)
736
// remove =.* from others
737
.map(s -> s.contains("=") ? s.substring(0, s.indexOf('=')) : s)
738
// skip known-to-be-there flags
739
.filter(s -> !ignoredXXFlags.contains(s))
744
var ignoredXFlags = Set.of(
745
// default, yet still seen to be explicitly set
747
// -XmxmNNNm added by run-test framework for non-hotspot tests
750
result &= allFlags.stream()
751
.filter(s -> s.startsWith("-X") && !s.startsWith("-XX:"))
754
.map(s -> s.substring(2))
755
// remove :.* from flags with values
756
.map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s)
757
// remove size like 4G, 768m which might be set for non-hotspot tests
758
.map(s -> s.replaceAll("(\\d+)[mMgGkK]", ""))
759
// skip known-to-be-there flags
760
.filter(s -> !ignoredXFlags.contains(s))
767
private Stream<String> allFlags() {
768
return Stream.of((System.getProperty("test.vm.opts", "") + " " + System.getProperty("test.java.opts", "")).trim().split("\\s+"));
772
* A string indicating the foreign linker that is currently being used. See jdk.internal.foreign.CABI
775
* "FALLBACK" and "UNSUPPORTED" are special values. The former indicates the fallback linker is
776
* being used. The latter indicates an unsupported platform.
778
private String jdkForeignLinker() {
779
return String.valueOf(CABI.current());
783
* Dumps the map to the file if the file name is given as the property.
784
* This functionality could be helpful to know context in the real
789
protected static void dump(Map<String, String> map) {
790
String dumpFileName = System.getProperty("vmprops.dump");
791
if (dumpFileName == null) {
794
List<String> lines = new ArrayList<>();
795
map.forEach((k, v) -> lines.add(k + ":" + v));
796
Collections.sort(lines);
798
Files.write(Paths.get(dumpFileName), lines,
799
StandardOpenOption.APPEND, StandardOpenOption.CREATE);
800
} catch (IOException e) {
801
throw new RuntimeException("Failed to dump properties into '"
802
+ dumpFileName + "'", e);
807
* Log diagnostic message.
811
protected static void log(String msg) {
812
// Always log to a file.
815
// Also log to stderr; guarded by property to avoid excessive verbosity.
816
// By jtreg design stderr produced here will be visible
817
// in the output of a parent process. Note: stdout should not be used
818
// for logging as jtreg parses that output directly and only echoes it
819
// in the event of a failure.
820
if (Boolean.getBoolean("jtreg.log.vmprops")) {
821
System.err.println("VMProps: " + msg);
826
* Log diagnostic message to a file.
830
protected static void logToFile(String msg) {
831
String fileName = "./vmprops.log";
833
Files.writeString(Paths.get(fileName), msg + "\n", Charset.forName("ISO-8859-1"),
834
StandardOpenOption.APPEND, StandardOpenOption.CREATE);
835
} catch (IOException e) {
836
throw new RuntimeException("Failed to log into '" + fileName + "'", e);
841
* This method is for the testing purpose only.
845
public static void main(String args[]) {
846
Map<String, String> map = new VMProps().call();
847
map.forEach((k, v) -> System.out.println(k + ": '" + v + "'"));