Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 7461:561148896559
8005076: Creating a CDS archive with one alignment and running another causes a crash.
Summary: Save the alignment when writing the CDS and compare it when reading the CDS.
Reviewed-by: kvn, coleenp
author | hseigel |
---|---|
date | Tue, 08 Jan 2013 13:38:11 -0500 |
parents | 4daebd4cc1dd |
children | 1f6d10b4cc0c 203f64878aab |
comparison
equal
deleted
inserted
replaced
7460:6c3f47d964f3 | 7461:561148896559 |
---|---|
1329 // It does not make sense to have big object alignment | 1329 // It does not make sense to have big object alignment |
1330 // since a space lost due to alignment will be greater | 1330 // since a space lost due to alignment will be greater |
1331 // then a saved space from compressed oops. | 1331 // then a saved space from compressed oops. |
1332 if ((int)ObjectAlignmentInBytes > 256) { | 1332 if ((int)ObjectAlignmentInBytes > 256) { |
1333 jio_fprintf(defaultStream::error_stream(), | 1333 jio_fprintf(defaultStream::error_stream(), |
1334 "error: ObjectAlignmentInBytes=%d must not be greater then 256\n", | 1334 "error: ObjectAlignmentInBytes=%d must not be greater than 256\n", |
1335 (int)ObjectAlignmentInBytes); | 1335 (int)ObjectAlignmentInBytes); |
1336 return false; | 1336 return false; |
1337 } | 1337 } |
1338 // In case page size is very small. | 1338 // In case page size is very small. |
1339 if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) { | 1339 if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) { |
1340 jio_fprintf(defaultStream::error_stream(), | 1340 jio_fprintf(defaultStream::error_stream(), |
1341 "error: ObjectAlignmentInBytes=%d must be less then page size %d\n", | 1341 "error: ObjectAlignmentInBytes=%d must be less than page size %d\n", |
1342 (int)ObjectAlignmentInBytes, os::vm_page_size()); | 1342 (int)ObjectAlignmentInBytes, os::vm_page_size()); |
1343 return false; | 1343 return false; |
1344 } | 1344 } |
1345 return true; | 1345 return true; |
1346 } | 1346 } |
2995 // Disable large pages to allow shared spaces. This is sub-optimal, since | 2995 // Disable large pages to allow shared spaces. This is sub-optimal, since |
2996 // there may not even be a shared archive to use. | 2996 // there may not even be a shared archive to use. |
2997 FLAG_SET_DEFAULT(UseLargePages, false); | 2997 FLAG_SET_DEFAULT(UseLargePages, false); |
2998 } | 2998 } |
2999 | 2999 |
3000 // Add 2M to any size for SharedReadOnlySize to get around the JPRT setting | |
3001 if (DumpSharedSpaces && !FLAG_IS_DEFAULT(SharedReadOnlySize)) { | |
3002 SharedReadOnlySize = 14*M; | |
3003 } | |
3004 | |
3005 if (DumpSharedSpaces) { | 3000 if (DumpSharedSpaces) { |
3006 if (RequireSharedSpaces) { | 3001 if (RequireSharedSpaces) { |
3007 warning("cannot dump shared archive while using shared archive"); | 3002 warning("cannot dump shared archive while using shared archive"); |
3008 } | 3003 } |
3009 UseSharedSpaces = false; | 3004 UseSharedSpaces = false; |