79352428

Date: 2025-01-13 14:05:44
Score: 2
Natty:
Report link

Your memory is overloaded. You allocate a large size memory to heap. Try next type for this case:

That readonly ref struct type provide safe memory usage and it allocated in stack. The alternative of that it's Memory. It's readonly struct

In your code i have seen a mistake. Fix it if you copied exact code. The type initialized in using construction would be disposed after it

using MemoryStream memoryStream = new MemoryStream();
{
    currentDocument.Save(memoryStream);
    currentDocument.Close(true);
    
    memoryStream.Position = 0;
    logger.LogDebug("Position {Position} and Length {Length} CanRead {CanRead}",
    memoryStream.Position, memoryStream.Length, memoryStream.CanRead);
    
    byte[] fileData = memoryStream.ToArray();
}

I hope that will help you. Can you give more information and code about it? Remind me if i say wrong

Reasons:
  • Whitelisted phrase (-1): hope that will help
  • RegEx Blacklisted phrase (2.5): Can you give
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: KonTuk