High memory pressure on elastic.co

Hi all!

Just a few days ago we have noticed a really high memory pressure on our elasticsearch cluster hosted on elastic.co.
We did some investigation. It turned out that it is caused by our integration tests which create unique indexes. I wrote some code to prove that theory in two cases:

  1. within a few threads in a loop created an index, then index many documents using bulk
  2. within a few threads in a loop created an index, then index many documents using bulk, and then delete previously created index

Both cases can be parametrized by threads count, unique indices count and number of documents to index per single index. I ran both scenarios few times in a row and I could observe memory pressure more than 90%. After that garbage collection is not performed anymore. Any ideas what could be an issue? Do you have any recommendations how to investigate it more?

Thanks!