question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scan data from es may have memory leak

See original GitHub issue

I found memory leak when I’ve got data from elasticsearch.

`import gc import time import psutil import elasticsearch from elasticsearch import Elasticsearch, helpers

print('elasticsearch version: ', elasticsearch.version) print(‘start mem: {:.4f} gb’.format(psutil.virtual_memory().used / 1024 / 1024 / 1024)) es = Elasticsearch(hosts=‘192.168.83.222:9200’) query = {‘query’:{‘term’:{‘ORG_NO’:‘3140201’}}} repl = helpers.scan(client=es, query=query, index=‘hb_mp_info-3140201-2020.10.10’, size=10000) l = [ele for ele in repl] del l gc.collect() time.sleep(5) print(‘end mem: {:.4f} gb’.format(psutil.virtual_memory().used / 1024 / 1024 / 1024))`

Run the above code, we can see: start mem: 6.3883 gb end mem: 7.2465 gb I feel that 0.86 gb memory ware leaking.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
pgomulkacommented, Mar 1, 2021

shouldn’t this be moved to elastic/elasticsearch-py ?

0reactions
Mihir-Gajera1commented, Nov 8, 2022

Having the same issue while using async_scan helper. any updates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

scan data from es may have memory leak #1540 - GitHub
I found memory leak when I've got data from elasticsearch. ... I feel that 0.86 gb memory ware leaking. The text was updated...
Read more >
How To Detect and Prevent Memory Leaks | Scout APM Blog
Leaks waste space by filling up pages of memory with inaccessible data and waste time due to extra paging activity. Leaked memory eventually ......
Read more >
Memory leak detection - How to find, eliminate, and avoid
Another method for memory leak detection is to use logging intelligently. Sometimes, faulty code doesn't cause a memory leak, but your users do....
Read more >
Node.js Memory Leak Detection: How to Debug & Avoid Them
In this article, you'll learn how to understand and debug the memory usage of a Node.js application and use monitoring tools to get...
Read more >
Find a Memory Leak | dotMemory Documentation - JetBrains
In this tutorial, we'll see how you can use dotMemory to locate and fix memory leaks in your apps. But before moving on,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found