Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27474

VS 2008 Out of memory

$
0
0
I have wrapped my code in try catch statements, and every once in a great while I get an exception 'system out of memory'. Today I got the message and I have done very little program/memory wise on a fresh boot this morning. I have messed around with Microsoft word some, and ran an example program that was 20 lines of code 2 or 3 times that did simple mathematical calculations. My computer is relatively new; I went to computer properties right after I got the out of memory message, and it says I have 2GB total, and 1.88GB free memory. I put in hint lines ads to track down exactly what line is causing the failure and it is in these few lines of code; ads = 3 executed. All of the code in convertHGLtoEMF() is wrapped in its own try catch statement. The error message came out of the calling sub:

Code:

ads = 3
temp = ConvertHGLtoEMF(File_Name) 'Convert the selected .HGL file
'load the converted graph into the picPlot picture box
Dim img As Image = Bitmap.FromFile(temp)
Dim bmp As New Bitmap(img)
img.Dispose()
ads = 4
If picPlot.Image IsNot Nothing Then picPlot.Image.Dispose()
picPlot.SizeMode = PictureBoxSizeMode.Zoom
picPlot.Image = bmp
IO.File.Delete(temp)


Viewing all articles
Browse latest Browse all 27474


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>