Skip to content

Commit

Permalink
Reduce memory usage in SimpleClusterStateIT#testLargeClusterStatePubl…
Browse files Browse the repository at this point in the history
…ishing (#73773)

In order to produce a large cluster state this test was creating 1000s
of text fields for index mappings. The in memory representation for
these mappings can consume all the heap causing OOMs. This commit
changes the mapping type for a boolean that's more lightweight.

Closes #73050
  • Loading branch information
fcofdez committed Jul 1, 2021
1 parent dc60a38 commit d70b090
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public void testLargeClusterStatePublishing() throws Exception {
int counter = 0;
int numberOfFields = 0;
while (true) {
mapping.startObject(UUIDs.randomBase64UUID()).field("type", "text").endObject();
mapping.startObject(UUIDs.randomBase64UUID()).field("type", "boolean").endObject();
counter += 10; // each field is about 10 bytes, assuming compression in place
numberOfFields++;
if (counter > estimatedBytesSize) {
Expand Down

0 comments on commit d70b090

Please sign in to comment.