Easy Imgur running out of memory
Closed this issue · 10 comments
Hi, I am trying to upload quite a few images, to be honest, but every time I try the .net framework throws an error that the uploader has run out of memory.
Is there a limit to the number of images or total file size that I should be aware of?
Thanks,
David
The error:
"See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.OutOfMemoryException: Out of memory.
at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
at EasyImgur.Form1.UploadAlbum(Boolean _Anonymous, String[] _Paths, String _AlbumTitle)
at EasyImgur.Form1.UploadFile(Boolean _Anonymous, String[] _Paths)
at EasyImgur.Form1.uploadFileAccountTrayMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.NotifyIcon.WndProc(Message& msg)
at System.Windows.Forms.NotifyIcon.NotifyIconNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2115.0 built by: NET47REL1LAST
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
EasyImgur
Assembly Version: 0.3.4.0
Win32 Version: 0.3.4
CodeBase: file:///C:/Users/david_hickox/Desktop/EasyImgur.exe
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2117.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
Newtonsoft.Json
Assembly Version: 4.5.0.0
Win32 Version: 0.3.4
CodeBase: file:///C:/Users/david_hickox/Desktop/EasyImgur.exe
System.ComponentModel.DataAnnotations
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.DataAnnotations/v4.0_4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2112.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
System.Xml.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
"
There's a pull request (#51) that aims to fix this issue by not loading all of the images into memory when uploading an album. I've pinged the author of the PR, let's see if we can get this fixed!
Well when I tested how many images it could upload I hit about 27 and the entire album was under 100 mb but it used nearly a gb of ram so it can't be just loading the imaages that does it infact I have enough ram to load all the images and have some left over, but it crashes at 1.5 gb of ram used, even though I have 12 free
Are the images mostly JPEG or PNG images (or some other compressed images)? A large JPEG image dimension-wise may be very efficiently encoded to produce a small filesize, but the raw image data takes 3 or 4 bytes per pixel in memory when decoded. Might be more, depending on the pixel format, of course. If you saved all of your images as BMPs, would they still be under 100 MB?
Ah I did not realize that they were stored raw, and yes that is the same issue, thanks!
Out of curiosity any clue on when this could be released because I'm not sure if I can compile it for myself.
Thanks.
David Hickox
Hi @dwhickox, I'll build and publish a new release for this later today!
Thanks :)
@dwhickox I just published a new release with the memory usage fix! You can get the latest version here!
Thanks!