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

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
    来源:知乎
    著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置