raandree / NTFSSecurity

Managing permissions with PowerShell is only a bit easier than in VBS or the command line as there are no cmdlets for most day-to-day tasks like getting a permission report or adding permission to an item. PowerShell only offers Get-Acl and Set-Acl but everything in between getting and setting the ACL is missing. This module closes the gap.
MIT License
431 stars 61 forks source link

High memory usage #16

Open MorNando opened 7 years ago

MorNando commented 7 years ago

I appear to have memory issues when combining get-childitem2 and get-ntfsaccess. It is holding over 2gb ram when running it against 22gb of data, 1,200 folders and 15,000 files. I tried exporting the data to csv first but it made no difference. Is there anything else I can do or is this a bug?

TechnicallyJoe commented 7 years ago

Could you provide a gist with the code you are using?

MorNando commented 7 years ago

Get-childitem2 $path -recurse | get-ntfsaccess | export-csv $outputpath -notypeinformation -append

On experimenting with the above, the ram usage increases when exporting to csv instead of throwing it away. When I remove export-csv the ram stays low.

That is fine for small to medium sized file structures but not for large ones. The problem is that this module is mainly geared for the larger ones in order to overcome the 260 character max_path limit.

The issue is get-ntfsaccess command holding memory when outputting to a csv.

MorNando commented 7 years ago

To expand further, it rose to 2gb ram when running my script instead of throwing that data away in the csv.