OpenJDK / jdk / jdk12
changeset 26298:297ca021b2ee
Merge
author | dcubed |
---|---|
date | Fri, 22 Aug 2014 11:23:36 -0700 |
parents | f179c0827318 5f5878285770 |
children | 0a42745f2b78 |
files | |
diffstat | 14 files changed, 95 insertions(+), 120 deletions(-) [+] |
line wrap: on
line diff
--- a/hotspot/make/windows/makefiles/vm.make Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/make/windows/makefiles/vm.make Fri Aug 22 11:23:36 2014 -0700 @@ -34,6 +34,9 @@ CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT" !else CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT" +!if "$(BUILDARCH)" == "amd64" +CXX_FLAGS=$(CXX_FLAGS) /homeparams +!endif !endif !if "$(Variant)" == "compiler1"
--- a/hotspot/src/os/windows/vm/os_windows.cpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/os/windows/vm/os_windows.cpp Fri Aug 22 11:23:36 2014 -0700 @@ -135,11 +135,6 @@ if (ForceTimeHighResolution) timeEndPeriod(1L); - // Workaround for issue when a custom launcher doesn't call - // DestroyJavaVM and NMT is trying to track memory when free is - // called from a static destructor - MemTracker::shutdown(); - break; default: break; @@ -414,6 +409,8 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo); +extern jint volatile vm_getting_terminated; + // Thread start routine for all new Java threads static unsigned __stdcall java_start(Thread* thread) { // Try to randomize the cache line index of hot stack frames. @@ -435,9 +432,17 @@ } } + // Diagnostic code to investigate JDK-6573254 (Part I) + unsigned res = 90115; // non-java thread + if (thread->is_Java_thread()) { + JavaThread* java_thread = (JavaThread*)thread; + res = java_lang_Thread::is_daemon(java_thread->threadObj()) + ? 70115 // java daemon thread + : 80115; // java non-daemon thread + } // Install a win32 structured exception handler around every thread created - // by VM, so VM can genrate error dump when an exception occurred in non- + // by VM, so VM can generate error dump when an exception occurred in non- // Java thread (e.g. VM thread). __try { thread->run(); @@ -453,6 +458,11 @@ Atomic::dec_ptr((intptr_t*)&os::win32::_os_thread_count); } + // Diagnostic code to investigate JDK-6573254 (Part II) + if (OrderAccess::load_acquire(&vm_getting_terminated)) { + return res; + } + return 0; }
--- a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java Fri Aug 22 11:23:36 2014 -0700 @@ -504,7 +504,7 @@ super.init(includes, defines); - getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); + getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag(), get("PlatformName"))); getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); } } @@ -619,7 +619,7 @@ abstract class CompilerInterface { abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); - abstract Vector getDebugCompilerFlags(String opt); + abstract Vector getDebugCompilerFlags(String opt, String platformName); abstract Vector getDebugLinkerFlags(); abstract void getAdditionalNonKernelLinkerFlags(Vector rv); abstract Vector getProductCompilerFlags();
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java Fri Aug 22 11:23:36 2014 -0700 @@ -357,7 +357,7 @@ } @Override - Vector getDebugCompilerFlags(String opt) { + Vector getDebugCompilerFlags(String opt, String platformName) { Vector rv = new Vector(); // Set /On option @@ -369,6 +369,10 @@ addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL"); // Set /Oy- option addAttr(rv, "OmitFramePointers", "false"); + // Set /homeparams for x64 debug builds + if(platformName.equals("x64")) { + addAttr(rv, "AdditionalOptions", "/homeparams"); + } return rv; }
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Fri Aug 22 11:23:36 2014 -0700 @@ -284,7 +284,7 @@ } - Vector getDebugCompilerFlags(String opt) { + Vector getDebugCompilerFlags(String opt, String platformName) { Vector rv = new Vector(); getDebugCompilerFlags_common(opt, rv);
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java Fri Aug 22 11:23:36 2014 -0700 @@ -48,7 +48,7 @@ } - Vector getDebugCompilerFlags(String opt) { + Vector getDebugCompilerFlags(String opt, String platformName) { Vector rv = new Vector(); getDebugCompilerFlags_common(opt,rv);
--- a/hotspot/src/share/vm/memory/filemap.cpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/vm/memory/filemap.cpp Fri Aug 22 11:23:36 2014 -0700 @@ -445,7 +445,7 @@ // close and remove the file. See bug 6372906. close(); remove(_full_path); - fail_stop("Unable to write to shared archive file.", NULL); + fail_stop("Unable to write to shared archive file."); } } _file_offset += nbytes; @@ -463,7 +463,7 @@ // that the written file is the correct length. _file_offset -= 1; if (lseek(_fd, _file_offset, SEEK_SET) < 0) { - fail_stop("Unable to seek.", NULL); + fail_stop("Unable to seek."); } char zero = 0; write_bytes(&zero, 1); @@ -534,7 +534,7 @@ // other reserved memory (like the code cache). ReservedSpace rs(size, os::vm_allocation_granularity(), false, requested_addr); if (!rs.is_reserved()) { - fail_continue(err_msg("Unable to reserve shared space at required address " INTPTR_FORMAT, requested_addr)); + fail_continue("Unable to reserve shared space at required address " INTPTR_FORMAT, requested_addr); return rs; } // the reserved virtual memory is for mapping class data sharing archive @@ -558,7 +558,7 @@ requested_addr, size, si->_read_only, si->_allow_exec); if (base == NULL || base != si->_base) { - fail_continue(err_msg("Unable to map %s shared space at required address.", shared_region_name[i])); + fail_continue("Unable to map %s shared space at required address.", shared_region_name[i]); return NULL; } #ifdef _WINDOWS @@ -584,7 +584,7 @@ void FileMapInfo::assert_mark(bool check) { if (!check) { - fail_stop("Mark mismatch while restoring from shared file.", NULL); + fail_stop("Mark mismatch while restoring from shared file."); } } @@ -709,7 +709,7 @@ void FileMapInfo::stop_sharing_and_unmap(const char* msg) { FileMapInfo *map_info = FileMapInfo::current_info(); if (map_info) { - map_info->fail_continue(msg); + map_info->fail_continue("%s", msg); for (int i = 0; i < MetaspaceShared::n_regions; i++) { if (map_info->_header->_space[i]._base != NULL) { map_info->unmap_region(i); @@ -717,6 +717,6 @@ } } } else if (DumpSharedSpaces) { - fail_stop(msg, NULL); + fail_stop("%s", msg); } }
--- a/hotspot/src/share/vm/memory/filemap.hpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/vm/memory/filemap.hpp Fri Aug 22 11:23:36 2014 -0700 @@ -190,8 +190,8 @@ bool remap_shared_readonly_as_readwrite(); // Errors. - static void fail_stop(const char *msg, ...); - static void fail_continue(const char *msg, ...); + static void fail_stop(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2); + static void fail_continue(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2); // Return true if given address is in the mapped shared space. bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
--- a/hotspot/src/share/vm/runtime/java.cpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/vm/runtime/java.cpp Fri Aug 22 11:23:36 2014 -0700 @@ -430,6 +430,8 @@ } } +jint volatile vm_getting_terminated = 0; + // Note: before_exit() can be executed only once, if more than one threads // are trying to shutdown the VM at the same time, only one thread // can run before_exit() and all other threads must wait. @@ -460,6 +462,8 @@ } } + OrderAccess::release_store(&vm_getting_terminated, 1); + // The only difference between this and Win32's _onexit procs is that // this version is invoked before any threads get killed. ExitProc* current = exit_procs;
--- a/hotspot/src/share/vm/services/mallocTracker.hpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/vm/services/mallocTracker.hpp Fri Aug 22 11:23:36 2014 -0700 @@ -171,8 +171,9 @@ // Total malloc'd memory used by arenas size_t total_arena() const; - inline size_t thread_count() { - return by_type(mtThreadStack)->malloc_count(); + inline size_t thread_count() const { + MallocMemorySnapshot* s = const_cast<MallocMemorySnapshot*>(this); + return s->by_type(mtThreadStack)->malloc_count(); } void reset();
--- a/hotspot/src/share/vm/services/memBaseline.cpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/vm/services/memBaseline.cpp Fri Aug 22 11:23:36 2014 -0700 @@ -70,15 +70,13 @@ */ class MallocAllocationSiteWalker : public MallocSiteWalker { private: - SortedLinkedList<MallocSite, compare_malloc_size, ResourceObj::ARENA> - _malloc_sites; + SortedLinkedList<MallocSite, compare_malloc_size> _malloc_sites; size_t _count; // Entries in MallocSiteTable with size = 0 and count = 0, // when the malloc site is not longer there. public: - MallocAllocationSiteWalker(Arena* arena) : _count(0), _malloc_sites(arena) { - } + MallocAllocationSiteWalker() : _count(0) { } inline size_t count() const { return _count; } @@ -109,13 +107,12 @@ // Walk all virtual memory regions for baselining class VirtualMemoryAllocationWalker : public VirtualMemoryWalker { private: - SortedLinkedList<ReservedMemoryRegion, compare_virtual_memory_base, ResourceObj::ARENA> + SortedLinkedList<ReservedMemoryRegion, compare_virtual_memory_base> _virtual_memory_regions; size_t _count; public: - VirtualMemoryAllocationWalker(Arena* a) : _count(0), _virtual_memory_regions(a) { - } + VirtualMemoryAllocationWalker() : _count(0) { } bool do_allocation_site(const ReservedMemoryRegion* rgn) { if (rgn->size() >= MemBaseline::SIZE_THRESHOLD) { @@ -136,39 +133,30 @@ bool MemBaseline::baseline_summary() { - assert(_malloc_memory_snapshot == NULL, "Malloc baseline not yet reset"); - assert(_virtual_memory_snapshot == NULL, "Virtual baseline not yet reset"); - - _malloc_memory_snapshot = new (arena()) MallocMemorySnapshot(); - _virtual_memory_snapshot = new (arena()) VirtualMemorySnapshot(); - if (_malloc_memory_snapshot == NULL || _virtual_memory_snapshot == NULL) { - return false; - } - MallocMemorySummary::snapshot(_malloc_memory_snapshot); - VirtualMemorySummary::snapshot(_virtual_memory_snapshot); + MallocMemorySummary::snapshot(&_malloc_memory_snapshot); + VirtualMemorySummary::snapshot(&_virtual_memory_snapshot); return true; } bool MemBaseline::baseline_allocation_sites() { - assert(arena() != NULL, "Just check"); // Malloc allocation sites - MallocAllocationSiteWalker malloc_walker(arena()); + MallocAllocationSiteWalker malloc_walker; if (!MallocSiteTable::walk_malloc_site(&malloc_walker)) { return false; } - _malloc_sites.set_head(malloc_walker.malloc_sites()->head()); + _malloc_sites.move(malloc_walker.malloc_sites()); // The malloc sites are collected in size order _malloc_sites_order = by_size; // Virtual memory allocation sites - VirtualMemoryAllocationWalker virtual_memory_walker(arena()); + VirtualMemoryAllocationWalker virtual_memory_walker; if (!VirtualMemoryTracker::walk_virtual_memory(&virtual_memory_walker)) { return false; } // Virtual memory allocations are collected in call stack order - _virtual_memory_allocations.set_head(virtual_memory_walker.virtual_memory_allocations()->head()); + _virtual_memory_allocations.move(virtual_memory_walker.virtual_memory_allocations()); if (!aggregate_virtual_memory_allocation_sites()) { return false; @@ -180,11 +168,6 @@ } bool MemBaseline::baseline(bool summaryOnly) { - if (arena() == NULL) { - _arena = new (std::nothrow, mtNMT) Arena(mtNMT); - if (arena() == NULL) return false; - } - reset(); _class_count = InstanceKlass::number_of_instance_classes(); @@ -211,8 +194,7 @@ } bool MemBaseline::aggregate_virtual_memory_allocation_sites() { - SortedLinkedList<VirtualMemoryAllocationSite, compare_allocation_site, ResourceObj::ARENA> - allocation_sites(arena()); + SortedLinkedList<VirtualMemoryAllocationSite, compare_allocation_site> allocation_sites; VirtualMemoryAllocationIterator itr = virtual_memory_allocations(); const ReservedMemoryRegion* rgn; @@ -230,12 +212,12 @@ site->commit_memory(rgn->committed_size()); } - _virtual_memory_sites.set_head(allocation_sites.head()); + _virtual_memory_sites.move(&allocation_sites); return true; } MallocSiteIterator MemBaseline::malloc_sites(SortingOrder order) { - assert(!_malloc_sites.is_empty(), "Detail baseline?"); + assert(!_malloc_sites.is_empty(), "Not detail baseline"); switch(order) { case by_size: malloc_sites_to_size_order(); @@ -251,7 +233,7 @@ } VirtualMemorySiteIterator MemBaseline::virtual_memory_sites(SortingOrder order) { - assert(!_virtual_memory_sites.is_empty(), "Detail baseline?"); + assert(!_virtual_memory_sites.is_empty(), "Not detail baseline"); switch(order) { case by_size: virtual_memory_sites_to_size_order(); @@ -270,8 +252,7 @@ // Sorting allocations sites in different orders void MemBaseline::malloc_sites_to_size_order() { if (_malloc_sites_order != by_size) { - SortedLinkedList<MallocSite, compare_malloc_size, ResourceObj::ARENA> - tmp(arena()); + SortedLinkedList<MallocSite, compare_malloc_size> tmp; // Add malloc sites to sorted linked list to sort into size order tmp.move(&_malloc_sites); @@ -283,8 +264,7 @@ void MemBaseline::malloc_sites_to_allocation_site_order() { if (_malloc_sites_order != by_site) { - SortedLinkedList<MallocSite, compare_malloc_site, ResourceObj::ARENA> - tmp(arena()); + SortedLinkedList<MallocSite, compare_malloc_site> tmp; // Add malloc sites to sorted linked list to sort into site (address) order tmp.move(&_malloc_sites); _malloc_sites.set_head(tmp.head()); @@ -295,8 +275,7 @@ void MemBaseline::virtual_memory_sites_to_size_order() { if (_virtual_memory_sites_order != by_size) { - SortedLinkedList<VirtualMemoryAllocationSite, compare_virtual_memory_size, ResourceObj::ARENA> - tmp(arena()); + SortedLinkedList<VirtualMemoryAllocationSite, compare_virtual_memory_size> tmp; tmp.move(&_virtual_memory_sites); @@ -308,10 +287,9 @@ void MemBaseline::virtual_memory_sites_to_reservation_site_order() { if (_virtual_memory_sites_order != by_size) { - SortedLinkedList<VirtualMemoryAllocationSite, compare_virtual_memory_site, ResourceObj::ARENA> - tmp(arena()); + SortedLinkedList<VirtualMemoryAllocationSite, compare_virtual_memory_site> tmp; - tmp.add(&_virtual_memory_sites); + tmp.move(&_virtual_memory_sites); _virtual_memory_sites.set_head(tmp.head()); tmp.set_head(NULL);
--- a/hotspot/src/share/vm/services/memBaseline.hpp Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/src/share/vm/services/memBaseline.hpp Fri Aug 22 11:23:36 2014 -0700 @@ -61,28 +61,22 @@ }; private: - // All baseline data is stored in this arena - Arena* _arena; - // Summary information - MallocMemorySnapshot* _malloc_memory_snapshot; - VirtualMemorySnapshot* _virtual_memory_snapshot; + MallocMemorySnapshot _malloc_memory_snapshot; + VirtualMemorySnapshot _virtual_memory_snapshot; size_t _class_count; // Allocation sites information // Malloc allocation sites - LinkedListImpl<MallocSite, ResourceObj::ARENA> - _malloc_sites; + LinkedListImpl<MallocSite> _malloc_sites; // All virtual memory allocations - LinkedListImpl<ReservedMemoryRegion, ResourceObj::ARENA> - _virtual_memory_allocations; + LinkedListImpl<ReservedMemoryRegion> _virtual_memory_allocations; // Virtual memory allocations by allocation sites, always in by_address // order - LinkedListImpl<VirtualMemoryAllocationSite, ResourceObj::ARENA> - _virtual_memory_sites; + LinkedListImpl<VirtualMemoryAllocationSite> _virtual_memory_sites; SortingOrder _malloc_sites_order; SortingOrder _virtual_memory_sites_order; @@ -93,30 +87,23 @@ // create a memory baseline MemBaseline(): _baseline_type(Not_baselined), - _class_count(0), - _arena(NULL), - _malloc_memory_snapshot(NULL), - _virtual_memory_snapshot(NULL), - _malloc_sites(NULL) { + _class_count(0) { } ~MemBaseline() { reset(); - if (_arena != NULL) { - delete _arena; - } } bool baseline(bool summaryOnly = true); BaselineType baseline_type() const { return _baseline_type; } - MallocMemorySnapshot* malloc_memory_snapshot() const { - return _malloc_memory_snapshot; + MallocMemorySnapshot* malloc_memory_snapshot() { + return &_malloc_memory_snapshot; } - VirtualMemorySnapshot* virtual_memory_snapshot() const { - return _virtual_memory_snapshot; + VirtualMemorySnapshot* virtual_memory_snapshot() { + return &_virtual_memory_snapshot; } MallocSiteIterator malloc_sites(SortingOrder order); @@ -133,10 +120,8 @@ // memory size_t total_reserved_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); - assert(_virtual_memory_snapshot != NULL, "No virtual memory snapshot"); - assert(_malloc_memory_snapshot != NULL, "No malloc memory snapshot"); - size_t amount = _malloc_memory_snapshot->total() + - _virtual_memory_snapshot->total_reserved(); + size_t amount = _malloc_memory_snapshot.total() + + _virtual_memory_snapshot.total_reserved(); return amount; } @@ -144,32 +129,30 @@ // virtual memory size_t total_committed_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); - assert(_virtual_memory_snapshot != NULL, - "Not a snapshot"); - size_t amount = _malloc_memory_snapshot->total() + - _virtual_memory_snapshot->total_committed(); + size_t amount = _malloc_memory_snapshot.total() + + _virtual_memory_snapshot.total_committed(); return amount; } size_t total_arena_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); - assert(_malloc_memory_snapshot != NULL, "Not yet baselined"); - return _malloc_memory_snapshot->total_arena(); + return _malloc_memory_snapshot.total_arena(); } size_t malloc_tracking_overhead() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); - return _malloc_memory_snapshot->malloc_overhead()->size(); + MemBaseline* bl = const_cast<MemBaseline*>(this); + return bl->_malloc_memory_snapshot.malloc_overhead()->size(); } - const MallocMemory* malloc_memory(MEMFLAGS flag) const { - assert(_malloc_memory_snapshot != NULL, "Not a snapshot"); - return _malloc_memory_snapshot->by_type(flag); + MallocMemory* malloc_memory(MEMFLAGS flag) { + assert(baseline_type() != Not_baselined, "Not yet baselined"); + return _malloc_memory_snapshot.by_type(flag); } - const VirtualMemory* virtual_memory(MEMFLAGS flag) const { - assert(_virtual_memory_snapshot != NULL, "Not a snapshot"); - return _virtual_memory_snapshot->by_type(flag); + VirtualMemory* virtual_memory(MEMFLAGS flag) { + assert(baseline_type() != Not_baselined, "Not yet baselined"); + return _virtual_memory_snapshot.by_type(flag); } @@ -180,24 +163,19 @@ size_t thread_count() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); - assert(_malloc_memory_snapshot != NULL, "Baselined?"); - return _malloc_memory_snapshot->thread_count(); + return _malloc_memory_snapshot.thread_count(); } // reset the baseline for reuse void reset() { _baseline_type = Not_baselined; - _malloc_memory_snapshot = NULL; - _virtual_memory_snapshot = NULL; + _malloc_memory_snapshot.reset(); + _virtual_memory_snapshot.reset(); _class_count = 0; - _malloc_sites = NULL; - _virtual_memory_sites = NULL; - _virtual_memory_allocations = NULL; - - if (_arena != NULL) { - _arena->destruct_contents(); - } + _malloc_sites.clear(); + _virtual_memory_sites.clear(); + _virtual_memory_allocations.clear(); } private: @@ -210,8 +188,6 @@ // Aggregate virtual memory allocation by allocation sites bool aggregate_virtual_memory_allocation_sites(); - Arena* arena() { return _arena; } - // Sorting allocation sites in different orders // Sort allocation sites in size order void malloc_sites_to_size_order();
--- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java Fri Aug 22 11:23:36 2014 -0700 @@ -26,7 +26,6 @@ * @bug 8024927 * @summary Testing address of compressed class pointer space as best as possible. * @library /testlibrary - * @ignore 8055164 */ import com.oracle.java.testlibrary.*; @@ -89,7 +88,6 @@ "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("HeapBaseMinAddress must be at least"); - output.shouldContain("HotSpot"); output.shouldHaveExitValue(0); }
--- a/hotspot/test/runtime/NMT/NMTWithCDS.java Fri Aug 22 09:55:49 2014 -0700 +++ b/hotspot/test/runtime/NMT/NMTWithCDS.java Fri Aug 22 11:23:36 2014 -0700 @@ -34,14 +34,15 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder( - "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); output.shouldHaveExitValue(0);