Repository navigation
Conversation
`Bitmap frame = new(path); frame = CropImage(frame, crop);` never disposed the full size bitmap. GDI+ pixels live in unmanaged memory the GC doesn't track, so 170k frames exhausted 32 GB of RAM plus Swap. - Add `ImageProcessor.LoadCroppedImage`, which disposes the source after cropping, and use it at every load site - Add `ImageProcessor.LoadCroppedPhash`, so frames are hashed and disposed one at a time, and pass digests to `GetHashDictSimilarity` - Dispose cropped bitmaps and the `CommonOpenFileDialog` - Enable CA2000 as an error (didn't catch the main issue here, but caught smaller ones) Fixes milankarman#27
|
I'm mentioning it here because it's somewhat related and will possibly conflict if I try to fix it now:
You'll be met with an IO exception like: If this seems out of scope I can make a separate issue and or investigate myself later. |
Oh, unless Wine emulates this, which I doubt. It probably can't even happen on Linux, since files are not automatically locked by processes. Don't worry about conflicts with any of my PRs, I'm proefficient enough in git to handle it :) Plus, I'm keeping this as draft for now. (in case https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/316 gets merged sooner rather than later) If you don't get to it before I do, I still have Windows machines to test. They're just not my daily driver. |
Bitmap frame = new(path); frame = CropImage(frame, crop);never disposed the full size bitmap. GDI+ pixels live in unmanaged memory the GC doesn't track, so 170k frames exhausted 32 GB of RAM plus Swap.ImageProcessor.LoadCroppedImage, which disposes the source after cropping, and use it at every load siteImageProcessor.LoadCroppedPhash, so frames are hashed and disposed one at a time, and pass digests toGetHashDictSimilarityCommonOpenFileDialogFixes #27
Keeping as a draft for now, because whilst this should work perfectly fine on Windows, I now hit the following two issues on Wine + X11:
Which make me go form "can't prepare frames on large videos (~40+ minutes at 1080p60)" to "can't prepare frames at all".