-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High main memory usage and hanging because of reading history since 2.8.5 #130
Comments
Thanks for reporting this! This is very interesting - I'm almost certain it will be f923682 which causing this issue. In that commit, I was trying to make auto-suggestions more intelligent by including context when searching the history for lines to suggest. To make this search more performant, I implemented a basic form of indexing of the history lines. Based on the input lag you're experiencing, I suspect something about your IPython history is causing the index to balloon. My history file is a similar size to yours (~21MB), but I don't see any memory or CPU spikes when the history is being processed. The indexing only involves basic string processing, so I wonder what is different about our history files that is causing this - does yours contain any extremely long lines by any chance? I suspect that limiting the length of lines processed, and / or limiting the size of the index will probably prevent the memory issue you're experiencing. |
Depends on what you'd consider "extremely long", but there are Side note. Not rarely I have a long string (possibly structured) |
That one 800,000 character entry would do it! I'm able to reproduce this by adding a history entry of similar length. I've made some optimizations to the history indexing in the uvx --no-cache --from 'git+https://github.com/joouha/euporie.git@373aea0' euporie-console Hopefully this helps! |
I use Here's a comparison. I ran Thus memory-wise, it depends. I might say it's still wasting ~110MiB with |
Amazing stuff -- so much you can do in a terminal!
Last two versions (2.8.5 and 2.8.6) of euporie exhibit a memory problem on my machine. On the
first stroke, say in
euporie-console
, RSS jumps to ~2.2GiB from expected 70-80MiB whileeverything hangs (possibly 1-2 characters of the input appear before hanging). After something
finally loaded, characters appear and the application works, but still quick input has a
visible display lag.
Here's a recording of
xterm euporie-console
on 2.8.6 (processes: xterm, sh, pythoneuporie-console, python -m ipykernel_launcher).
euporie
installed likepipx install --python python3.11 euporie=={version}
.I quickly ran
euporie.console
throughmemray
. You have an issue reading IPythonhistory I assume:
Just in case, I use IPython kernels a lot (Jupyter Lab, specific version of Nteract with
reasonable IxD, raw ipython too a bit, all for different things, and was looking for a
faster alternative to Nteract), but I don't have gigabytes of command history.
The text was updated successfully, but these errors were encountered: