src/share/vm/memory/metaspaceShared.cpp

changeset 4396
6c3f47d964f3
parent 4278
070d523b96a7
child 4434
c793367610c1
     1.1 --- a/src/share/vm/memory/metaspaceShared.cpp	Wed Jan 02 20:28:09 2013 -0500
     1.2 +++ b/src/share/vm/memory/metaspaceShared.cpp	Mon Jan 07 15:32:51 2013 -0500
     1.3 @@ -689,9 +689,15 @@
     1.4  bool MetaspaceShared::map_shared_spaces(FileMapInfo* mapinfo) {
     1.5    size_t image_alignment = mapinfo->alignment();
     1.6  
     1.7 -  // Map in the shared memory and then map the regions on top of it
     1.8 +#ifndef _WINDOWS
     1.9 +  // Map in the shared memory and then map the regions on top of it.
    1.10 +  // On Windows, don't map the memory here because it will cause the
    1.11 +  // mappings of the regions to fail.
    1.12    ReservedSpace shared_rs = mapinfo->reserve_shared_memory();
    1.13    if (!shared_rs.is_reserved()) return false;
    1.14 +#endif
    1.15 +
    1.16 +  assert(!DumpSharedSpaces, "Should not be called with DumpSharedSpaces");
    1.17  
    1.18    // Map each shared region
    1.19    if ((_ro_base = mapinfo->map_region(ro)) != NULL &&
    1.20 @@ -708,8 +714,10 @@
    1.21      if (_rw_base != NULL) mapinfo->unmap_region(rw);
    1.22      if (_md_base != NULL) mapinfo->unmap_region(md);
    1.23      if (_mc_base != NULL) mapinfo->unmap_region(mc);
    1.24 +#ifndef _WINDOWS
    1.25      // Release the entire mapped region
    1.26      shared_rs.release();
    1.27 +#endif
    1.28      // If -Xshare:on is specified, print out the error message and exit VM,
    1.29      // otherwise, set UseSharedSpaces to false and continue.
    1.30      if (RequireSharedSpaces) {

mercurial