codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.92k stars 363 forks source link

crash on sorting 4k lines of C# #562

Open MrZakos opened 6 years ago

MrZakos commented 6 years ago

Environment

Description

CTRL+M+Z on a .cs file shows sorting result , than still 'thinking' and than crushing visual studio, reopening visual studio shows no changes on the file

codecadwallader commented 6 years ago

Thanks for reporting the issue. There is a linear performance impact based on the size of the file, so we have seen some issues with large files. Have you noticed if CPU or memory is spiking when attempting to sort your file?

MrZakos commented 6 years ago

yes both CPU and memory spikes than few seconds later crush , tried on 2 different PC with skylake cpu and 16 GB ram

pedro-lb commented 6 years ago

I have the same problem, using Visual Studio 2017 Professional, C# and CodeMaid 10.5.1.

Is there any error log that CodeMaid generates that we can possibly share here?

codecadwallader commented 6 years ago

I suspect it's simply blowing out a memory buffer as the size of the data is quite large that it's trying to sort. If you take a look at our logic, it's pretty basic but it definitely will not scale infinitely so I would expect it to fail at some point, depending on how much memory is available. https://github.com/codecadwallader/codemaid/blob/master/CodeMaid/Integration/Commands/SortLinesCommand.cs