life清者自清 2017-08-17 06:39 采纳率: 66.7%
浏览 1550
已结题

c# 开发的软件有个截图的功能,有时候点击截图按钮就会出现内存不足的问题,详细信息如下:

一点截图按钮屏幕变成红叉号导致卡死,弹出错误信息。币没了,求大佬们帮忙

图片说明

************** 异常文本 **************
System.OutOfMemoryException: 内存不足。
在 System.Drawing.TextureBrush..ctor(Image image, WrapMode wrapMode)
在 System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g, Image backgroundImage, Color backColor, ImageLayout backgroundImageLayout, Rectangle bounds, Rectangle clipRect, Point scrollOffset, RightToLeft rightToLeft)
在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
在 System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
在 System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)
在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
在 System.Windows.Forms.Control.WmPaint(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • 写回答

3条回答 默认 最新

  • 叫兽-郭老师 新星创作者: Java技术领域 2017-08-17 06:52
    关注

    同学,你该重启电脑了。不想重启电脑的话就去windows task manager那里关掉一些在跑的占大量内存的process吧,别把windows explore误关了就行了。不然的话就看看你那些data set里面是不是缓存了太大量的数据(无限循环、堆栈溢出),你设计的flow是否需要优化。这三招都行不通的话,你就要去买内存条了。

    作者:RitaW
    链接:https://www.zhihu.com/question/52923109/answer/154502383
    来源:知乎
    著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

    评论

报告相同问题?