src/hotspot/share/gc/g1/g1FromCardCache.cpp
changeset 50281 bc1336220671
parent 49608 1852b17b0efc
--- a/src/hotspot/share/gc/g1/g1FromCardCache.cpp	Mon May 28 09:59:11 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1FromCardCache.cpp	Mon May 28 11:13:21 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,9 @@
                                                              num_par_rem_sets,
                                                              &_static_mem_size);
 
-  invalidate(0, _max_regions);
+  if (AlwaysPreTouch) {
+    invalidate(0, _max_regions);
+  }
 }
 
 void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {