You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello - thank you for creating this library, its very useful.
I'm getting OutOfMemoryException when trying to scan large files 500mb and bigger. Sharing the details below:
I took a look at the CopyToByteArray() method implementation, but not sure what should be modified. I'm able to successfully open the same big file using File.OpenRead (returns FileStream) and File.ReadAllBytes (returns byte array). I wonder if CopyToByteArray() could be modified to handle large files. Is this something that could be addressed?
Thanks in advance!
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at MalwareScan.AMSI.MalwareScanner.CopyToByteArray(Stream stream)
at MalwareScan.AMSI.MalwareScanner.HasVirus(Stream stream, String filename)
The text was updated successfully, but these errors were encountered:
Apologies @AlexVPerl, I missed this.
Yes, looking at that code it is horribly inefficient and will do way to many memory allocations. It would be much easier with more modern .Net versions.
I am no longer actively maintaining this and I don't have the relevant frameworks on my machine.
The code change should be as simple as doing this: https://stackoverflow.com/a/33611922/11534
(Ironically, the code currently in the library is from a different answer on that same SO question :)).
Hello - thank you for creating this library, its very useful.
I'm getting OutOfMemoryException when trying to scan large files 500mb and bigger. Sharing the details below:
I took a look at the CopyToByteArray() method implementation, but not sure what should be modified. I'm able to successfully open the same big file using File.OpenRead (returns FileStream) and File.ReadAllBytes (returns byte array). I wonder if CopyToByteArray() could be modified to handle large files. Is this something that could be addressed?
Thanks in advance!
The text was updated successfully, but these errors were encountered: