--- a/hotspot/src/share/vm/classfile/stringTable.cpp Mon May 23 08:02:04 2016 +0200
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp Mon May 23 09:57:17 2016 +0200
@@ -740,7 +740,8 @@
} else {
int num_buckets = the_table()->number_of_entries() /
SharedSymbolTableBucketSize;
- CompactStringTableWriter writer(num_buckets,
+ // calculation of num_buckets can result in zero buckets, we need at least one
+ CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1,
&MetaspaceShared::stats()->string);
// Copy the interned strings into the "string space" within the java heap