Skip to content
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

PSReadLine cannot handle super large history file properly #3771

Closed
3 tasks done
ajayguptarrk opened this issue Aug 7, 2023 · 12 comments · Fixed by #3810
Closed
3 tasks done

PSReadLine cannot handle super large history file properly #3771

ajayguptarrk opened this issue Aug 7, 2023 · 12 comments · Fixed by #3810
Labels
Area-HistoryImprovements Label for tracking different improvements to history Area-Stability Label for tracking stability Issues In-PR A PR is opened targeting the issue Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@ajayguptarrk
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

System out of memory  and it consume lots of memory when i see in task manager.

Screenshot

image

Environment data

PS Version: 5.1.14393.5582
PS HostName: ConsoleHost
PSReadLine Version: 1.2
PSReadLine EditMode: Windows
OS: 10.0.14393.0 (rs1_release.160715-1616)
BufferWidth: 139
BufferHeight: 3000

Steps to reproduce

Start powershell in visual code or windows it always crashed

Expected behavior

always crashed

Actual behavior

Start powershell in visual code or windows it always crashed

@StevenBucher98
Copy link
Collaborator

It looks like you are on a pretty old version of PSReadLine, can you try upgrading to the latest stable version (2.2.6) and see if you still come across the issue? You can upgrade by running the following:
Install-Module -Name PSReadLine -RequiredVersion 2.2.6
Be sure to restart PowerShell session for changes to take affect

@StevenBucher98 StevenBucher98 added Needs-Author Feedback Area-Stability Label for tracking stability Issues labels Aug 7, 2023
@ajayguptarrk
Copy link
Author

ajayguptarrk commented Aug 7, 2023 via email

@StevenBucher98
Copy link
Collaborator

@ajayguptarrk I cant seem to see the image you attached to the issue, can you please try to reattach it again? Maybe via GitHub instead of email.

@ajayguptarrk
Copy link
Author

Hi, I have updated the same but now again the same exception has come. [image: image.png] Thanks and RegardsAjay Kumar Gupta *

On Mon, 7 Aug 2023 at 21:45, Steven Bucher @.
> wrote: It looks like you are on a pretty old version of PSReadLine, can you try upgrading to the latest stable version (2.2.6) and see if you still come across the issue? You can upgrade by running the following: Install-Module -Name PSReadLine -RequiredVersion 2.2.6 Be sure to restart PowerShell session for changes to take affect — Reply to this email directly, view it on GitHub <#3771 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMRQWRPGKRBMB3G2EBQTC3XUEIAJANCNFSM6AAAAAA3G46CL4 . You are receiving this because you authored the thread.Message ID: @.*>

@ajayguptarrk
Copy link
Author

Please see if you are able to see updated image

@ajayguptarrk
Copy link
Author

Sure .please find attached image.

@daxian-dbw
Copy link
Member

@ajayguptarrk I still cannot see the updated image. The image above still shows it's a very old version -- 2.0.0-beta2 or prior indicated by the reporting URL:
image

@daxian-dbw daxian-dbw added Needs-Repro There is no sufficient information on repro steps. and removed Needs-Attention 👋 labels Aug 7, 2023
@StevenBucher98
Copy link
Collaborator

Unfortunately it does not seem like we can see the images still @ajayguptarrk

@daxian-dbw daxian-dbw added Resolution-Not Repro The issue cannot be reproduced. and removed Area-Stability Label for tracking stability Issues labels Aug 7, 2023
@ajayguptarrk
Copy link
Author

Sorry there was some issue in uploading image. Please look updated screen shot and let me know if i can do anything else.
image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention 👋 and removed Needs-Repro There is no sufficient information on repro steps. labels Aug 8, 2023
@ajayguptarrk ajayguptarrk reopened this Aug 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Aug 8, 2023
@daxian-dbw daxian-dbw removed the Resolution-Not Repro The issue cannot be reproduced. label Aug 8, 2023
@StevenBucher98 StevenBucher98 added the Area-Stability Label for tracking stability Issues label Aug 14, 2023
@daxian-dbw
Copy link
Member

@ajayguptarrk The size of your history file is too big -- it exceeds the size limit of a generic list in .NET (~2 GB).
We should fix PSReadLine to work with super large history file, but for now, you can easily work around it by deleting some of the early history text from the history file. By default, the history file is saved at c:\Users\<user-name>\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt on Windows.

@daxian-dbw daxian-dbw added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. Needs-Attention 👋 labels Aug 14, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Aug 14, 2023
@daxian-dbw daxian-dbw changed the title Powershell crashed when starting PSReadLine cannot handle super large history file properly Aug 14, 2023
@kilasuit
Copy link

@daxian-dbw this would be another good reason for this feature request as that would move it outside of .NET limitations

@StevenBucher98 StevenBucher98 added the Area-HistoryImprovements Label for tracking different improvements to history label Aug 21, 2023
@daxian-dbw
Copy link
Member

Even after moving to using sqlite for history, the file-based history saving will need to be preserved indefinitely to make it backward compatible. I'm planning to update the code to only read the last 1mb content from the history file, so this issue can be avoided.

@StevenBucher98 StevenBucher98 removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Aug 21, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR A PR is opened targeting the issue label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-HistoryImprovements Label for tracking different improvements to history Area-Stability Label for tracking stability Issues In-PR A PR is opened targeting the issue Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants