Page 1 of 1

Out of memory Error

Posted: Thu Mar 21, 2019 2:41 pm
by stewartde
First THANK YOU so very much for creating this fantastic software.
I've needed the ability to scan greater than 10MHz.

I'm not sure where you want us to report issues.
So, I thought a new thread on the board is best?
Please correct me if I am wrong.


As I dragged the corner of the window to make it larger, I got the error below:

Image

My display is a 4K TV with a resolution of 3840x2160
However the window was about 2/3 that size or so..


Also, I am a c# developer for about 17 years and C++ Win32 API before that.
So, I hope you take this as constructive help and not with any malice intended.
Make sure you are using "USING"s around any temp images or drawing object not needed after the scope of the OnPaint event.
It also helps the Garbage collector to set the large local variables to NULL before they go out of scope
(That way the GC will immediatly remove the reference from it's list
and not have to search through all references before determining if the object can be cleaned up)
Or better yet, use the same image directly by changing that one without creating new ones each time.
However, I can only guess without seeing your OnPaint event code.
Also, I can see your compiling for 32-bit, might you be able to offer a 64-bit build?

Here are the error details:

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.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect)
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.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.3362.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
RSP-SAS Spectrum Analyser
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/Andrew%20Developments/RSP-Spectrum%20Analyser/RSP-Spectrum%20Analyser.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3062.0 built by: NET472REL1
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.3324.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3062.0 built by: NET472REL1
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.3062.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.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:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

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.

Re: Out of memory Error

Posted: Fri Mar 22, 2019 7:04 am
by SteveAndrew
Hi Stewart
stewartde wrote:I'm not sure where you want us to report issues.
So, I thought a new thread on the board is best?
Please correct me if I am wrong.
The administrator has made a new sticky-thread for all feedback and discussion on this version.

Many thanks for the detailed error report for an out_of_memory error. I had the same error some time ago but I couldn't trace far enough back on the call stack to see where I was triggering the problem. The problem disapeared and I assumed something I'd done elsewhere in the code had cleared it. It has been added to the debug list.

Best regards

Steve