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.

PSReadLine cannot handle super large history file properly

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a month ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kilasuitcommented, Aug 21, 2023

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

0reactions
daxian-dbwcommented, Aug 21, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Limit size of ConsoleHost_history.txt file · Issue #537
Recently, accessing command history via the up-arrow has been quite slow (3-5 seconds to respond), and today, when I opened PowerShell, ...
Read more >
Managing the PSReadline History File
When the file gets very large, performance starting PowerShell can be affected. This command will trim the history file to a specified ...
Read more >
Powershell PSReadLine History
Commands entered using PSReadLine are (typically) appended to the history file as they are entered (this behaviour can also be controlled using ...
Read more >
Leverage PowerShell History across multiple machines
So, once I had PSReadLine installed on my PC I verified the location of my history file by using the Get-PSReadLineOption command.
Read more >
Powershell history isn't persistent anymore
Using Import-Module PSReadLine makes the history work properly. As a workaround, I put the command into the PS profile file, so it gets...
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