Write-SqlTableData with ProgressAction set to Continue appears to be consuming considerably more memory than with SilentlyContinue
Write-SqlTableData with ProgressAction set to Continue appears to be consuming considerably more memory than with SilentlyContinue.
When ProgressAction is set to continue we observed the memory usage to be growing at a faster rate up to a point where it slows down every data input using a pipeline.
When ProgressAction is set to SilentlyContinue, we observe reasonable memory usage and no slowdown in the data input using a pipeline.
Testing with IIS logs as sources.
Mock code: Get-Content <iis log file> | ? { $_ -inotmatch '^#' } | Write-SqlTableData -Force...
Processing a file of only 3000 lines may cause PowerShell to consume over 4GiB of memory if ProgressAction is set to Continue. Barely ~400 MiB if set to SilentlyContinue.
Using SqlServer v22.3.0 with ISE 5.1. The issue is also observed with PowerShell 5.1.
This may be related to the closed issue #75.
Hi @pf-malandry - interesting.
I'll have to take a look and see what is going on.
Chiming in to mention this issue is definitely still present, as well as a parallel action with using -erroraction stop
Occurs with SQLServer module v 22.3.0 in powershell 7.5.1 running in vscode
I have a script that repeatedly calls Write-SqlTableData to add a single line at a time after a test is performed. Each time the task repeats, the memory does not appear to clear properly at the end, despite displaying 100% complete in the console, eventually (After hundreds of iterations via loop over time) this results in the memory use of the powershell session growing to fill all available memory and eventually crashing.