# Elasticsearch Python Lib

**URL:** <https://discuss.elastic.co/t/elasticsearch-python-lib/339751>\
**Category:** Elasticsearch\
**Created:** [August 1, 2023, 6:17am UTC](https://discuss.elastic.co/t/elasticsearch-python-lib/339751 "2023-08-01T06:17:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_Burman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_burman/32/118310_2.png) [@Vivek\_Burman](https://discuss.elastic.co/u/Vivek_Burman)\
**Post date:** [August 1, 2023, 6:17am UTC](https://discuss.elastic.co/t/elasticsearch-python-lib/339751/1 "2023-08-01T06:17:58Z")

</div>

Hi, I'm using Elastic Search python lib (8.8.2) to bulk insert data into a index. There are almost 2lakh+ documents I need to insert.

I'm using parallel\_bulk api to sync them, but as I track the process RAM usage I see Parallel\_bulk creates threads to process the data and the _virtual memory footprint of those threads keeps on increasing_.

I have 32GB RAM on the machine where from data is pushed. And Elastic Search is on a separate machine with 32GB RAM.

Is there anyway to limit the memory usage of these threads????  
Tried setting thread\_count to 1 but it still does not respects it

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 29, 2023, 6:18am UTC](https://discuss.elastic.co/t/elasticsearch-python-lib/339751/2 "2023-08-29T06:18:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
